Docsity

Computer Systems - Programming Assignment 1 | EENG 449, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
EENG449b/CMSC439b
Programming Assignment #1
Professor Andreas Savvides
Teaching Assistant: Dimitrios Lymberopoulos
dimitrios.lymber[email protected]
February 2, 2005
Class url: http://www.eng.yale.edu/enalab/courses/2005s/eeng449b/
Due date: February 16, 2005. Demonstration during TA’s office hours.
1 Introduction
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:
•The XYZ’s architecture.
•Configuring the GPIO pins of the OKIML67Q5002 processor.
•Programming and using the OKIML67Q5002’s hardware timers.
•Sampling the on-board sensors.
•Programming and using the UART interface
The assignment consists of two parts that are described in detail in the next sections. The starting code for this
assignment is posted on the class website.
2 Tools Presentation
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.
3 Assignment Part 1 (GPIO and Timers)
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.
pf3

Partial preview of the text

Download Computer Systems - Programming Assignment 1 | EENG 449 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

EENG449b/CMSC439b

Programming Assignment

Professor Andreas Savvides

[email protected]

Teaching Assistant: Dimitrios Lymberopoulos

[email protected]

February 2, 2005

Class url: http://www.eng.yale.edu/enalab/courses/2005s/eeng449b/ Due date: February 16, 2005. Demonstration during TA’s office hours.

1 Introduction

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:

  • The XYZ’s architecture.
  • Configuring the GPIO pins of the OKIML67Q5002 processor.
  • Programming and using the OKIML67Q5002’s hardware timers.
  • Sampling the on-board sensors.
  • Programming and using the UART interface The assignment consists of two parts that are described in detail in the next sections. The starting code for this assignment is posted on the class website.

2 Tools Presentation

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.

3 Assignment Part 1 (GPIO and Timers)

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.