AT89C5132
19.3.1
19.3.2
Master Configuration
The SPI operates in master mode when the MSTR bit in SPCON is set.
Slave Configuration
The SPI operates in slave mode when the MSTR bit in SPCON is cleared and data has been
loaded in SPDAT.
19.3.3
19.3.4
Data Exchange
There are two possible Policies to exchange data in master and slave modes:
•
polling
•
interrupts
Master Mode with Polling Policy
Figure 19-9 shows the initialization phase and the transfer phase flows using the polling policy.
Using this flow prevents any overrun error occurrence.
•
•
•
•
The bit rate is selected according to Table 97.
The transfer format depends on the slave peripheral.
SS may be deasserted between transfers depending also on the slave peripheral.
SPIF flag is cleared when reading SPDAT (SPSTA has been read before by the “end of
transfer” check).
This policy provides the fastest effective transmission and is well adapted when communicating
at high speed with other Microcontrollers. However, the procedure may then be interrupted at
any time by higher priority tasks.
125
4173E–USB–09/07