The purpose of this lab was the introduction of the Motorola 68HC11 on the CME-11E9-EVBU
development board from a hardware perspective, and to use assembly code to manipulate
external devices; in this particular case, LED’s connected to the PORTB interface.
The board was placed into a single-chip mode, to allow writes only to occur to PORTB.
Following the instructions in the handout, the anodes of four LED’s (from the front bin – the
back bin contained blinking LED’s) were connected to PB0 – PB3 , with the cathodes connected
to resisters (acting as current limiters), which were, in turn, connected to ground.
For labs 12,
13, and 14, an additional four LED’s were added in the same manner, and connected to PB4 –
The board was connected to the serial port on the PC, and was then connected to a power source
(note: the power source was disconnected when adding the additional four LED’s.)
The first lab consisted of the initial setup, then loading and compiling the provided demo
Lab 1 Flowchart
Lab 1 Source Code
), then uploading the compiled program
(lab1.s19) to the development board, and beginning execution.
These steps were accomplished
interface program on the PC.
This program turns off all the LED’s, pauses, then turns them on, pauses, then repeats the cycle.
The program code, itself, begins with instructions to equate the string “PORTB” with $1004,
which is the address for port B on the board interface.
The next instruction, ORG $0100,
indicates that the next byte (i.e. the start of the program in this case) should be located at $0100.
The rest of the program breaks down as follows:
sets the label “Main”, and loads hexadecimal 00 (in immediate
Mode) into the A register
stores the A register into PORTB, effectively turning off all LED’s
loads hex FFFF into the Y register
labels “Delay1”, and decrements the Y register by 1
checks the value of the Z condition code register (e.g. if the “dey”
instruction has not reduced the value in the Y register to zero, then
go to Delay1)
load $0F (%1111) into the A register
store the value in register A into PORTB (e.g. write a ‘1’ to each of
the first four lines (PB0 – PB3) on PORTB, effectively turning on
all the LED’s.