Homework 17 - button connected to Port A pin 0. Initially,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 2220 Homework #17 Due: Friday, July 23 The purpose of this exercise is to practice setting up and using a programmable timer to trigger periodic interrupts. In this case, the periodic action will be to change the pattern on some LEDs, as done in the previous homework. One of the timer channels (your choice) is to be configured to operate in “output compare” mode to trigger interrupts every 10msec. Assume an oscillator clock frequency of 8 MHz (bus clock = 4MHz). As in the previous homework an “IO_LED” component (a set of 8 LEDs) is to be connected to PORT P, with the program displaying the following repeating patterns on the 8 LEDs: 00000001-00000010-00000100-00001000-00010000-00100000-01000000-10000000-00000001…. The pattern is to change either every half second or every second, as selected by a push
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: button connected to Port A pin 0. Initially, the rate should be one half second. When the button is pressed, the rate should change to one second. When the button is pressed again, the rate should return to one half second, and so on. Note that only one change should occur per push button press. The only function of the main program, after initializing the timer, ports, and variables, is to continuously check the push button, and set a variable to indicate whether the pattern should change every half second or every second. The interrupt service routine should keep track of elapsed time since the last LED change, and change the LED pattern when the selected delay has occurred (one half second or one second)....
View Full Document

This note was uploaded on 09/23/2011 for the course ELEC 2220 taught by Professor Staff during the Summer '08 term at Auburn University.

Ask a homework question - tutors are online