
V PERIPHERAL MODULES 3 (INTERFACE): SERIAL PERIPHERAL INTERFACE (SPI)
V-2-8
EPSON
S1C33E07 TECHNICAL MANUAL
6. Check to see if the RDFF (D2/0x301714) is set to 1 by polling or using the interrupt and read data from the
SPI Receive Data Register (0x301700). When data is read from the SPI Receive Data Register (0x301700),
RDFF (D2/0x301714) is cleared to 0.
Furthermore, by setting RXDE (D2/0x301708) to 1, a receive DMA request is output to the ITC. This
DMA request can be used to store the received data to other memory without using the interrupt above.
RXDE: Receive DMA Enable Bit in the SPI Control Register 1 (D2/0x301708)
To receive data successively in master mode, write dummy data or transmit data to the SPI Transmit Data
Register (0x301704) every time a data frame is received. The SPI circuit continues the receive operation
when any data has been written to the SPI Transmit Data Register (0x301704). However, the SPI circuit
delays starting the next receiving for the number of SPI_CLK cycles specified with the SPI Wait Register
(0x301710). The clock output is suspended until after the expiration of the delay time.
When receiving data in slave mode without any data transmission, it is not necessary to write data to the
SPI Transmit Data Register (0x301704). The receive process activates by the clock input from the master
device. When performing data transmission simultaneously, write transmit data to the SPI Transmit Data
Register (0x301704) according to the data transmit procedure.
7. Repeat Steps 5 and 6 until all data are received.
In the same manner as transmission, BSYF (D6/0x301714) is set to 1 when data is being received in master
mode.
8. After all data has been received, write 0 to ENA (D0/0x301708) to turn the SPI circuit off.
In slave mode, write 0 to SS (D10/0x30170C) to set this SPI slave to deselected status before writing 0 to
ENA (D0/0x301708).
MCLK
ENA
DIV_CLK (master mode)
SPITXD[31:0] (master mode)
SPI_CLK pin (CPHA = 1)
SPI_CLK pin (CPHA = 0)
Data input pin
Shift register
SPIRXD[31:0]
BSYF
RDFF
Interrupt
Data A
AMSB
BMSB
AMSB-1
A0
B0
Write
Wait cycles (master mode)
(SPIW + 1)
× Tc(DIV_CLK)
Data receive interrupt
dummy
BMSB-1
Figure V.2.5.2 Data Receive Timing Chart (CPOL = 0)
Receive data overflow
The SPI Receive Data Register (0x301700) is overwritten if a data reception has finished when the previously
received data has not been read from the register. Therefore, when data is being received continuously, receive
data must be read before the following data reception finishes.
If the SPI Receive Data Register (0x301700) is overwritten when RDFF (D2/0x301714) = 1 (the received data
has not been read yet), RDOF (D3/0x301714) is set to 1. A receive data overflow interrupt can be generated si-
multaneous with this flag set to 1. Use this interrupt for error recovery.
RDOF: Receive Data Overflow Flag in the SPI Status Register (D3/0x301714)
RDOF (D3/0x301714) is reset to 0 by reading data from the SPI Receive Data Register (0x301700).