Datasheet

164
4341H–MP3–10/07
AT8xC51SND2C/MP3B
Figure 19-11. Slave SPI Polling Flows
19.3.7 Slave Mode with Interrupt Policy
Figure 19-10 shows the initialization phase and the transfer phase flows using the interrupt.
The transfer format depends on the master controller.
Reading SPSTA at the beginning of the ISR is mandatory for clearing the SPIF flag. Clear is
effective when reading SPDAT.
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