EE 308
Homework #11
Due April 3, 1996
The figure below shows two HC11s and an MC68HC11T1 Real Time Clock
connected via the SPI interface:
- Write some C code which will set the correct time in the master's Real
Time Clock.
- Write some C code which will set up the PIA ports on the master HC11 so
that:
- The master PIA Port A is an input.
- PIA Port A does not use handshaking, and interrupts are disabled.
- The master PIA Port B is an output.
- PIA Port B does not use handshaking, and interrupts are disabled.
- Write an IRQ interrupt service routine for the master which will read
the data sent from the master on the SPI. The master will then read the time
from the Real Time Clock
and write the data and the time to the PC display.
- Write some C code which will set up the PIA ports on the slave HC11 so
that:
- The slave PIA Port B is an output.
- PIA Port B does not use handshaking, and interrupts are disabled.
- Write an SPI interrupt service routine for the slave which will read the
data sent to it by the master, add 0x1000 to it, find the value in the
corresponding register. It will send that value to its Serial Peripheral
Data Register, and bring Bit 0 of Port B low. It will then wait until the
master has read the data, then bring Bit 0 of Port B back high, and leave the
routine.
Bill Rison,
<rison@ee.nmt.edu >