31-05-2012, 10:39 AM
The HC11- First microprocessor
The HC11-First microprocessor.pdf (Size: 21.31 KB / Downloads: 26)
Abstract
A microcontroller is a microprocessor that controls everyday
appliances such as microwaves and wristwatches. The
microkits used by computer engineering classes use a Motorola
HC11 microcontroller for all of the processing. The HC11
microkits have 8 input switches, a single interrupt request button
(IRQ), 8 output LEDs, and a two-line liquid crystal display
(LCD). The HC11 kit also has a pulse accumulator, or a
counter, which is incremented once per clock cycle. I wrote a
program for the HC11 that computes two random numbers
and adds or subtracts them, depending on the user input. The
procedure I used to compute a random number is simply this:
When an external interrupt is encountered (the interrupt request
(IRQ) button is depressed), take the remainder of the
pulse accumulator (counter) divided by 9. The result of this
operation gives a number between 0 and 9. Do this twice,
adding or subtracting the values and displaying the result in
hexadecimal format to the LCD. Simultaneously with the addition
or subtraction, step the lights once in their light pattern,
flipping all of the on lights to off and vice versa.
Introduction
The HC11A8 is the first microprocessor in a line of HC11
processors by Motorola. These microkits are used in a few
computer engineering courses at UCSC. The first of these
courses is computer engineering 12c, introduction to computer
organization. In the second half of this class, the students are
asked to program in HC11 assembly language, which gives
students an abstract view of the way a computer works.
Initially, the program (a hexadecimal adder and subtractor)
prints a welcome message and enters an infinite loop waiting
for an interrupt. The interrupt is received in the form of the
IRQ pin by the switches, and will begin the program. Before
depressing this button, select a function by entering the binary
pattern string on the switches.
Results
Unanticipated Features (Bugs)
1. Lights flash slower when switches are 0000 0011. This is
because the restart routine will display welcome messages
to the LCD. Each message has a short delay, thus slowing
the entire procedure.
2. As soon as value on SWITCHES changes to 0000 0011,
the program goes to restart mode, not waiting for the IRQ
to be depressed.
3. Lights do not flash while displaying answer. This is because
the answer is calculated and displayed from within
the interrupt, and the light flashing routine is in the main
program.
4. Interrupts are not debounced. That is, one press of the
IRQ may spawn several nested interrupts. The consequence
is a number of result digits are displayed onto the
screen.
5. Only one digit arithmetic is supported.
6. Result of addition of 8+8=G, which is not a hexadecimal
value.