Montana Tech of The University of Montana
Computer Science & Software Engineering

CSCI 255
Introduction to Embedded Systems
Fall 2011


Lab #8 - Scrolling LEDs v2.0

DUE: Mon Nov 7th, 2PM
You will be converting your LED scrolling assembler program to C. You will also be adding functionality to the two other push buttons, one will reverse the scrolling direction and the other will invert the LEDs.

Create a C program that uses a 16-bit timer and interrupt service routines to make an LED scrolling display. The LEDs show a particular pattern (initially a single on LED) that scrolls left at a certain speed. The pattern should wrap around. When a 1-0 transition is detected on INT0, the LEDs should update themselves to a seemingly random pattern obtained from the low byte of your running 16-bit timer. The INT0 interrupt should be high-priority while the timer interrupt updating the LEDs should be low-priority.

The speed of the scrolling is controlled by the push buttons. Initially the LEDs should update themselves once every second. The minimum time delay between changing the LEDs should be 0.02 seconds. The maximum time delay should be 2 seconds. In this week's version, all four push buttons will be used: In order to have all the ports and timers defines, you'll need to have include <REG52.h> at the top of your C program. Note that since we aren't debouncing the push buttons, the toggle and invert buttons will occasionally seem to not work.
Submission. Submit your program to the Lab #8 dropbox on Moodle. Be sure your submitted source file has the required header with your name, username, and a description of the program. Your program will be graded on functionality, readability and elegance.

Page last updated: August 16, 2012.  Copyright © 2011 by Keith Vertanen.