EE 308
Homework #12
Due April 10, 1996
An HC11 is connected to a PC by its asynchronous serial port. The PC buad
rate is set at 4800. Write a program which will read characters from the
PC in an interrupt service routine. Every time it receives a new character
from the PC, it will echo that character back to the PC, and increment a
count on Port B of the 6821. If it receives a "!" from the PC, it will
send the line
"\r\n\n Hello, world!\r\n\n"
to the PC.
- Write some C code which will set up PIA Port B on the HC11 so
that:
- PIA Port B is an output.
- PIA Port B does not use handshaking, and interrupts are disabled.
- Write some C code which will set up the SCI to enable the transmitter
and receiver, and enable the RDRF interrupt. It should also set the baud rate
to 4800.
- Write an SCI interrupt service routine. When the HC11 is interrupted
because the PC has sent it a new character, it should read that character,
send it back to the PC, and increment PIA Port B, unless the character is a
"!". For a "!", it should send the "Hello, world" phrase to the PC.
- Put the above parts together and complete the required program.
Bill Rison,
<rison@ee.nmt.edu >