At8xc51snd1c – Rainbow Electronics AT89C51SND1C User Manual
Page 154
154
AT8xC51SND1C
4109E–8051–06/03
Slave Mode with Polling
Policy
Figure 121 shows the initialization phase and the transfer phase flows using the polling.
The transfer format depends on the master controller.
SPIF flag is cleared when reading SPDAT (SPSTA has been read before by the “end of
reception” check).
This provides the fastest effective transmission and is well adapted when communicat-
ing at high speed with other Microcontrollers. However, the process may then be
interrupted at any time by higher priority tasks.
Figure 121. Slave SPI Polling Flows
SPI Initialization
Polling Policy
Disable interrupt
SPIE = 0
SPI Transfer
Polling Policy
Data Received?
SPIF = 1?
Select Slave Mode
MSTR = 0
Select Format
program CPOL & CPHA
Enable SPI
SPEN = 1
Prepare Next Transfer
write data in SPDAT
Get Data Received
read SPDAT
Prepare Transfer
write data in SPDAT