EE 308 -- LAB 10
Synchronous Serial Communications on the 68HC11
In this lab, one HC11 board (the master) will be used to query another HC11
board (the slave) about its status. The master HC11 will send a byte to the
slave HC11. The slave HC11 will return to the master the value in its
corresponding register -- e.g., if the master sends the slave the number
0x2B, the slave will return the value of its BAUD register
0x102B. In this manner, the master can find out the value of any register
inside the slave. We will use the Motorola SPI interface for communications
between the two boards.
Connect two HC11 EVBU boards together as shown below. The switch going to the
TIC1 line on the Master HC11 should be one of the debounced switches on
Figure 1: Connection of two HC11 EVBU boards for serial communication.
- Program the master HC11 board as follows:
- Program the master's Real Time Clock with the correct time.
- When the switch is pressed, the falling edge should generate a
Timer Input Capture 1 interrupt. In the interrupt service routine, the master
will read the dip switches connected to its PIA Port A, send that number to the
slave over its SPI, then return from the interrupt service
- When the slave brings the master's IRQ line low, the master will enter
an IRQ interrupt service routine. In that routine, the master will read
the value of the register from the slave and the time from the Real Time
Clock, and display the time and the value of the slave's register on the PC's
- Program the slave HC11 board as follows:
- An interrupt will be generated when the slave receives data on its SPI.
In the interrupt service routine, the slave should read the value from the SPI
and find the contents of the appropriate internal register. It should write
that data to its SPI data register, then bring Bit 0 of PIA Port B low to
tell the master it has its data ready. It should wait until the master reads
the data in the SPI, then bring Bit 0 of PIA Port B high, and return from the
interrupt service routine.
- Verify that the system works properly. For example, have the master
determine the value of the slave's BAUD register, and verify that it is
- Connect your logic analyzer to the master's MOSI, MISO,
SCLK, IRQ, tt PIA Port B Bit 0, Port D Bit 5 and E Clock
lines. Trigger your logic analyzer of the falling edge of the master's
TIC1 line. Measure the following times, and compare (where appropriate) to
the values specified on the MC6821 data sheet:
- The time from the falling edge on TIC1 to data being sent over the
SPI. This is how long it takes the master to get into the TIC1
interrupt service routine, read Port E, and send the data.
- The SPI clock frequency.
- Verify that the data on the SPI is valid on the falling edge of
SCLK, and the the data is sent with the most significant bit first.
Fri Mar 29 1996
© 1996, New Mexico Tech