ECEN 3213 Fall 2001 Lab Assignment #6

Subroutines

98765

You have two weeks to work on this lab. This lab is due at the end of your assigned lab period the week of November 12th.


For this Lab use the M68HC11A8, which is the version diagrammed in Figure 1.28 on page 24 of the Valvano book. The complete technical information is located on the Book’s CD in the file: D:\PDF\6811\HC11A8.pdf For all labs you are to bring your pre-lab design work, which may include diagrams, flow charts, Pseudo code, test case descriptions, and some text descriptions of the project. At the beginning of the lab, submit your pre-lab design work. For this lab pre-lab documentation, in addition to the usual flow chart and memory map, state diagram, be sure to include a block diagram for the two subroutine blocks, including listing inputs and outputs. At the end of the lab turn in the disk with be all of your simulation files. This disk will be returned to you each lab to submit the results of that lab. Be sure the disk is labeled with your name, ECEN3213, and the meeting day and time for your lab. The files for the project should include at least the assembly program and the simulation results for your test cases. You must demonstrate correct (error free) assembly and at least one test case execution to the lab instructor before you submit your disk.

Program requirements:

The same basic functionality as Lab 5, but add the handshake and functionality in a subroutine that does Seven Segment check and conversion. For the Seven Segment Code see Valvano Table 8.7 on page 448.
Input 8 bits on PORT E that are either 2 BCD digits or one of two Seven Segment code digits (This will take reading two bytes in a row, with handshaking). The handshake protocol listed below determines whether to consider the input as BCD or Seven Segment.
Test for legal input values.
Count the number of illegal values input, and stop when the error count hits 255.
output all 1's on Port C when error value is detected.
convert legal input to binary value.
Store up to 100 binary values in memory.
Output the converted result to Port C.
-Count the number of values translated.
-output all (up to 100) stored values on the Port C, When count of stored values hits 100 or when the handshake protocol says to Dump values.
-Use PORT A and PORT B for the following handshake protocol:
Port APort B
a2a1a0b7b6b5b4b3b2b1b0.
001........Port E ready to be read, and input values are 2 BCD digits
011........Port E ready to be read, and input values are Seven Segment
101........Dump all Stored Values on Port C
000........No new data, and no action yet
110........Byte received from dump, ready for another byte
111........Reset-to-0 all counts
.........01Ready to read Port E
.........10Finished reading port E
....00..1..Error on Data Conversion
......01..0Output of values in progress
......10...Output of values finished
....01..0..BCD successfully converted and stored
...1......0Number of stored values is 100.


For this lab, use the following simulator setup:
Use keypad for input on Port A.
Use 8 switches for input on Port E, for input of either BCD or Seven Segment codes.
Hook the LCD to Port C for output of converted values.
Hook the LEDs to Port B pins for the I/O handshake protocol.


Feel free to email comments and suggestions to John_M_Acken@acken.com

Red Stars red