R01UH0823EJ0100 Rev.1.00
Page 1387 of 1823
Jul 31, 2019
RX23W Group
38. Serial Peripheral Interface (RSPIa)
38.3.10
SPI Operation
38.3.10.1
Master Mode Operation
The only difference between single-master mode operation and multi-master mode operation lies in mode fault error
detection (refer to
section 38.3.8, Error Detection
). When operating in single-master mode, the RSPI does not detect
mode fault errors whereas the RSPI running in multi-master mode does detect mode fault errors. This section explains
operations that are common to single-master mode and multi-master mode.
(1) Starting a Serial Transfer
The RSPI updates the data in the transmit buffer (SPTX) when data is written to the RSPI data register (SPDR) with the
RSPI transmit buffer being empty (the SPTEF flag is 1 and data for the next transfer is not set). When the shift register is
empty after the number of frames set in the SPDCR.SPFC[1:0] bits are written to the SPDR, the RSPI copies data from
the transmit buffer to the shift register and starts serial transfer. Upon copying transmit data to the shift register, the RSPI
changes the status of the shift register to “full”, and upon termination of serial transfer, it changes the status of the shift
register to “empty”. The status of the shift register cannot be referenced.
For details on the RSPI transfer format, refer to
section 38.3.5, Transfer Format
. The polarity of the SSLAi output
pins depends on the SSLP register settings.
(2) Terminating a Serial Transfer
Irrespective of the SPCMDm.CPHA bit, the RSPI terminates the serial transfer after transmitting an RSPCKA edge
corresponding to the final sampling timing. If free space is available in the receive buffer (SPRX) (the SPRF flag is 0),
upon termination of serial transfer, the RSPI copies data from the shift register to the receive buffer of the SPDR register.
It should be noted that the final sampling timing varies depending on the bit length of transfer data. In master mode, the
RSPI data length depends on the SPCMDm.SPB[3:0] bit setting. The polarity of the SSLAi output pin depends on the
SSLP register settings.
For details on the RSPI transfer format, refer to
section 38.3.5, Transfer Format
.