

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Class url: http://www.eng.yale.edu/enalab/courses/2005s/eeng449b/ Due date: February 16, 2005. Demonstration during TA’s office hours.
The purpose of this assignment is to familiarize you with the core concepts of embedded systems programming. For this task you will use the XYZ sensor node. After finishing this assignment you should be fluent with the following:
An extra session will take place on Monday at 4:00pm in the CO40 lab. The purpose of this session is to familiarize you with the tools that you will use for compiling, downloading and debugging your programs on the XYZ sensor node. If there is a time conflict with your class schedule please send an email to the TA of the class as soon as possible.
In this part you have to create a 3-bit binary counter on the XYZ sensor node. The value of the counter should be increased by 1 every second. When the counter overflows (current value of the counter is 7 and a second has elapsed) it should be automatically reset to its initial value: 0. The counter continues to count seconds even after an overflow. The current value of the counter should be monitored at all times on the 3 on-board LEDs (red, yellow and green). The most significant bit (MSB) of the counter should be monitored on the red LED, while the least significant bit (LSB) of the counter should be monitored on the yellow LED. A high level flowchart of the binary counter application can be seen in Figure 1. First, you have to select and configure the GPIO pins of the processor that are necessary to the application. Then, you have to configure one of the available hardware timers appropriately, so that you can count seconds. After initializing the hardware timer, create a timer handler that implements the 3-bit binary counter.
GPIO pins configuration (LEDs)
ELAPSED TIME = 1 SECOND?
Configuration of a hardware timer to count seconds
Initialization of the 3-bit binary counter to value: 0
Monitor current value of counter on the LEDs
Start the hardware timer
Increase current value of counter by 1
COUNTER OVERFLOW?
Reset the value of the counter to value: 0
Monitor current value of counter on the LEDs
YES
NO
YES NO
Figure 1: High level flowchart of the 3-bit binary counter application.