{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern