AT89C5132
Figure 19-10. Master SPI Interrupt Policy Flows
SPI Initialization
Interrupt Policy
SPI Interrupt
Service Routine
Select Master Mode
MSTR = 1
Read Status
Read SPSTA
Select Bit Rate
Program SPR2:0
Get Data Received
Read SPDAT
Select Format
Program CPOL & CPHA
Start New Transfer
Write Data in SPDAT
Enable Interrupt
ESPI =1
Last Transfer?
Enable SPI
SPEN = 1
Deselect Slave
Pn.x = H
Select Slave
Pn.x = L
Disable Interrupt
SPIE = 0
Start Transfer
Write Data in SPDAT
19.3.6
Slave Mode with Polling Policy
Figure 19-11 shows the initialization phase and the transfer phase flows using the polling policy.
The transfer format depends on the master controller.
SPIF flag is cleared when reading SPDAT (SPSTA has been read before by the “end of recep-
tion” check).
This policy provides the fastest effective transmission and is well adapted when communicating
at high speed with other Microcontrollers. However, the procedure may be interrupted at any
time by higher priority tasks.
127
4173E–USB–09/07