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.

  1. Write some C code which will set up PIA Port B on the HC11 so that:

  2. 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.

  3. 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.

  4. Put the above parts together and complete the required program.



Bill Rison, <rison@ee.nmt.edu >