AT8xC51SND2C
Slave Mode with Polling
Policy
Figure 112 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 112. Slave SPI Polling Flows
SPI Initialization
Polling Policy
SPI Transfer
Polling Policy
Disable interrupt
Data Received?
SPIE = 0
SPIF = 1?
Select Slave Mode
MSTR = 0
Get Data Received
read SPDAT
Select Format
program CPOL & CPHA
Prepare Next Transfer
write data in SPDAT
Enable SPI
SPEN = 1
Prepare Transfer
write data in SPDAT
165
4341D–MP3–04/05