159.233 Assignment 3 – A 2051 Stopwatch

Due 7th June 2005


Write an assembler program that will make the 2051 simulator act as a stop-watch.
Use the serial I/O features of the simulator to mimic the switches and display of the stop-watch.

A letter ‘S’ or ‘s’ typed on the keyboard starts and stops the watch.
A letter ‘R’ or ‘r’ typed on the keyboard resets the watch to zero.

The display does NOT give a continuous readout of the time.
It displays a reading only when a Stop or Reset signal is received.
The watch just carries on from when it was Stopped if it is Started again without a Reset.

The display is of the form:
mm:ss.hh (minutes, seconds and hundredths of a second)
and is displayed using the serial interface.

Hints:
You can use either polled or interrupt driven code.
Set up timer 1 to act as the bit rate for the serial channel,
use the auto-reload mode with the value for 9600bps as found in the lecture notes.
Use timer 0 to provide timing for the stop-watch – be careful not to lose cycles!
Assume that the simulator is running with a crystal frequency of 11.0592 Mhz.
The simulator does not run in real time, so your stop-watch will not produce accurate results.

Your assignment will be judged on accuracy, readability, documentation and code length.

Hand in your .asm file electronically using the web page.

Make sure your id is on a comment line at the beginning of your code and use comments for documentation.

Marks will be subtracted for plagiarism, late submission and bad documentation.


M Johnson 2005