ECEN 3213 Fall 2004 Lab Assignment #4
You have two and a half weeks to work on this lab( Fall Break is in the middle).
You need to submit a flow chart, block diagram, and memory map
at the beginning of your lab class during
the week of October 18th.
This lab is due at the end of your assigned lab period the week of
November 2nd.
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 Books 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.
For this lab the pre-lab design work is
a flow chart of your program,
a memory map(be sure to include the two arrays of indexed values)
and a block diagram of the connections to the 6811.
At the beginning of the
lab, submit your pre-lab design work.
After you have demonstrated correct operation to the TA, then
submit the text version of the ASM source code via the web page.
You must demonstrate correct (error free) assembly and at
least one test case execution to the lab instructor before you
submit your source code.
Program requirements:
Use these requirements from Lab 3:
Load a value from Port E into register A.
Use the simulator switches to set values on Port E; Mask
the high order 4 bits and use
the lowest order 4 bits as one BCD digit, test whether the BCD value
is legal, and stop if the BCD value is illegal.
Keep reading port E until all 4 of the
high order bits are $A. Then test whether the BCD value
is legal, and stop if the BCD value is illegal.
Connect port B to the LCD for display.
Input an ASCII character from the CRT display into the serial
input pin on Port D.
Check whether the character is 0 through 9, and if it is not then
it is illegal and you should stop.
Convert the ASCII character to a binary number.
Output the switch input BCD result to the lowest order 4 bits of Port B and the
ASCII converted number to the high order bits.
Connect three bits of Port C to LEDs: bit 0 to a red LED, bit1 to
a yellow LED, and bit 2 to a green LED. Before conversion, turn on all three LEDs.
After checking, if either value is illegal turn off all three LEDs before stopping.
After converting the legal values, light the Green LED if the BCD number is
greater, Light the Yellow LED if the values are equal, and the red LED if
the converted ASCII is greater than the BCD.
After conversions and comparison, read Port E until high order 4 MSBs
(Most Significant Bits) are $5.
Then turn off all three LEDs and go back to the beginning to read Port E until
the high order bits are $A.
New requirements include:
Add two indexed arrays of values, one array to have fixed values in EPROM and
another array to store and retrieve converted values.
Output the BCD result to the lowest order 4 bits of Port B and the
converted number to the high order bits. Store up to 100 of these side-by-side
values to memory.
After 100 side-by-side values have been saved, then output all 100 values
to the LCD one at a time waiting for the value on bit 0 of Port E to change before
sending a value to the LCD. Specifically, when bit 0 of Port E is a 0, then an even
position can be output, when bit 0 of Port E is a 1 then an odd position can be output.
Store the following values in EPROM:
$e2$e4$e7$e6$d2$d4$d7$d5$b1$c3$08$f6$c1$05$17$16$05$f6$d8$f6$e4$d5$f8$b3
After the 100 stored values are output, then use the input switches to set a number of
EPROM values to be output. After each value is output, stop and wait for the run button to be
pushed to output the next value. Keep looping through the specified number of values.
For example, if the the switches are set to 00000010 that means two values. So after
the 100 stored values are output, then the output would be $E2. The program would stop.
Then the operator pushes the simulator run button and the output would be $E4. The
program stops, the operator pushes the run button and the output is
$E7 .
Questions to be demonstrated:
Does your program always stop after 100 values have been read?
Does your program output fewer than a 100 values when an illegal value
has been read?
[ECEN3213]
[Announcements]
[Schedule]
[Syllabus]
[Assignments]
Feel free to email comments and suggestions to
acken@okstate.edu