Implement a reaction test timer using the ARM development board
The objectives of this assignment are to demonstrate an understanding of:
- Programming a microcontroller using the C programming language.
- The use of the parallel I/O port of a microcontroller.
- The use of the interrupt system of a microcontroller.
2. The Task
The objective of this assignment is to implement a reaction test timer using the ARM development board. Using the Eclipse IDE load and run this program on the ARM development board before continuing with the assignment.
The reaction timer displays the time it takes for the user to react to an LED being illuminated. It displays the time in seconds to an accuracy of one thousandth of a second.
- On start-up or after a reaction test has completed, LED 1 should flash to indicate Button 1 is to be pressed to start the next reaction test.
- When Button 1 is pressed, the display is zeroed; all the LEDs are turned OFF and begin to count down (turn ON) at the rate of one of each 0.5 second.
- When all the LEDs turn ON, a random LED is turned GREEN indicating the button that should be pressed to stop the count. At the same time the display begins counting, showing the elapsed time.
- When the indicated button is pressed the display stops counting and displays the time required for the user to react. The timer is ready for the next reaction test (returns to step 1).
If the user presses any button other than the button indicated by the LED the count should continue. If the user fails to react, the count stops at 9.999 seconds.
If the user presses one or more buttons before the countdown finishes, the countdown is suspended until all the buttons are released.
The reaction timer should use the Programmable Interval Timer (PIT) to ensure an accurate time period and the SevenSegmentDisplay library to turn the OLED display into a 4-digit seven-segment display device.
When the reaction period starts the display should begin counting the elapsed time.
You will need to create functions to read the state of the Buttons and set the colour of the LEDs. Use the template files ButtonFunctions.c and
LEDFunctions.c to create your own library functions. If you wish you could use the provided Button and LED libraries.
You are provided with a program (Assignment 1) containing a skeleton main routine. Additional local routines and/or variables may also need to be provided to achieve the required functionally.
You will be assessed on the source code you submit. All code will be recompiled before testing. Marks will be awarded as follows:
- Well Commented Code (20%) All the functions should be well commented, describing their purpose and operation.
- Well Structured Code (10%) All the code produced should be well structured and use appropriate layout and control statements.
- Display Functionality (40%) The marks for the Display Functionality are made up as follows: Use of
PIT interrupts (10%)
Display of elapsed time (10%)
Reaction Time count stops at 9.999 (10%)
Accuracy of Reaction Time count (10%)
- Button/LED Interface (30%)
The marks for the Display Functionality are made up as follows:
Implementation of Button functions (10%)
Implementation of LED functions (10%)
Flashing LED start indicator (10%)