Project 1: Digital I/O and Timing
- All components of the project are due by March 5th at 5:00pm.
- Two person groups are required
Project Goals
At the end of this project, you should be able to:
- Create, compile, and download code to the Atmel Mega8, and
- Manipulate digital I/O lines
Project Components
Part 1
- Implement an internal 4-bit counter.
- The state of the counter is indicated using 4 LED channels:
- Bit 0: Blue
- Bit 1: Green
- Bit 2: Red
- Bit 3: Yellow
- Each time the button is released, the counter should increment.
- If it was in a state of 0xf, then it should roll over to 0x0.
Part 2
- Produce a musical tone using the speaker. This tone should be
produced continuously (no pauses). Note that tones can be
produced by turning the speaker "on" and "off" at some
frequency.
- The frequency of the tone should increase with higher counter
values. (alternatively, you could play one bar of Yankee
Doodle with each counter value)
Things You Should Know
We are using the bion
boards for this project (so no hardware development).
- There are three debugging LEDs (red, green, and yellow) attached to PORTB, pins 0, 1, 2
- The blue LEDs are all attached to PORTC, pin 5
- The piezoelectric speaker is attached to PORTD, pin 2
- Switch 1 is the reset switch (pushing it will cause the processor to reboot)
- Switch 2 is attached to PORTD, pin 3. This pin will read 1 when the button is not pressed and 0 when it is pressed.
References:
Implementation Notes
- Modularize your code: keep routines simple. For example, you
should separate the counting process from the LED state changes
(i.e., we expect you to implement a DisplayCounter() function that is
responsible for updating the state of the LEDs)
What to Hand In
All components of the project are due by March 5th at 5:00pm.
- Group report: Turn in your documented code to the
project 3 digital dropbox on D2L (text format). Only hand in
one copy of code per 2-person group.
- Group demonstration: Demonstrate your working
implementation to either a TA or the instructor).
This demonstration is due at the same time as the
reports.
- Personal report: State the relative contribution of you
and your partner (in terms of percentage of effort) (text format only!)
Grading
- 50%: Project implementation
- 25%: Demonstration of working project
- 25%: Internal documentation of the code
fagg [[at]] cs.ou.edu
Last modified: Wed Feb 11 00:19:16 2009