|
You are to design a stopwatch on the AVR board. The stopwatch has:
* A 2 digit seven segment display for displaying the current time
* A push button (P) for stopping and starting the stopwatch
The system operates as follows: When the system is reset (I.E. the board is programmed or the reset button is pressed) the displayed time is cleared to 00. When the push button (P) is pressed the stopwatch starts counting up once every 10th of a second in decimal. i.e. the left hand digit on the display will display seconds elapsed, while the right hand digit displays 10ths of seconds. When P is pressed again, the stopwatch pauses at its current value. The stopwatch can be started and stopped again by continually pressing P. Once the timer reaches 9.9 seconds it stops counting and continues to display "99" until reset.
Complete this specification as you see fit and if needed consult the newsgroup to resolve any issues.
Use a timer with an interrupt to measure the 0.1 second intervals and update the timer. Use an external interrupt to detect the push button press.
Implement your stopwatch in both assembler and C code. Compile your C program and compare the generated list file to your assembly program.
코드좀 부탁드려요...!
|