Serial Peripheral Interface Module (SPI)

Queuing Transmission Data

MC68HC908MR16/MC68HC908MR32 — Rev. 4.0 Advance Information

MOTOROLA Serial Peripheral Interface Module (SPI) 265

Figure 13-11. SPRF/SPTE CPU Interrupt TimingFor a slave, the transmit data buffer allows back-to-back transmissions without the slave precisely timing its writes between transmissions as in a system with a single data buffer. Also, if no new data is written to the data buffer, the last value contained in the shift registe r is t he next data word to be transmitted.For an idle master or idle slave that has no data loaded into its transmit buffer, the SPTE is set again no more than two bus cycles after the transmit buffer empties into the shift register. This allows the user to queue up a 16-bit value to send. For an already active slave, the load of the shift register cannot occur until the transmission is completed. This implies that a back-to-back write to the transmit data register is not possible. The SPTE indicates when the next write can occur.
BIT
3
MOSI
SPSCK
SPTE
WRITE TO SPDR 1
CPU WRITES BYTE 2 TO SPDR, QUEUEING BYTE 2
CPU WRITES BYTE 1 TO SPDR, CLEARING SPTE BIT.
BYTE 1 TRANSFERS FROM TRANSMIT DATA
3
1
2
2
3
5
REGISTER TO SHIFT REGISTER, SETTING SPTE BIT.
SPRF
READ SPSCR
MSBBIT
6BIT
5BIT
4BIT
2BIT
1LSBMSBBIT
6BIT
5BIT
4BIT
3BIT
2BIT
1LSBMSBBIT
6
BYTE 2 TRANSFERS FROM TRANSMIT DATA
CPU WRITES BYTE 3 TO SPDR, QUEUEING BYTE
BYTE 3 TRANSFERS FROM TRANSMIT DATA
5
8
10
8
10
4FIRST INCOMING BYTE TRANSFERS FROM SHIF T
6CPU READS SPSCR WITH SPRF BIT SET.
4
6
9
SECOND INCOMING BYTE TRANSFERS FROM SH IFT
9
11
AND CLEARING SPTE BIT.
REGISTER TO SHIFT REGISTER, SE TTING SPTE BIT.
REGISTER TO RECEIVE DATA REGISTER, SETT ING
SPRF BIT.
3 AND CLEARING SPTE BIT.
REGISTER TO SHIFT REGISTER, SETTING SPTE BIT.
REGISTER TO RECEIVE DATA REGISTER, SETT ING
SPRF BIT.
12 CPU READS SPDR, CLEARING SPRF BIT.
BIT
5BIT
4
BYTE 1 BYTE 2 BYTE 3
712
READ SPDR
7CPU READS SPDR, CLEARING SPRF BIT.
11 CPU READS SPSCR WITH SPRF BIT SET.
CPHA:CPOL = 1:0