R01UH0823EJ0100 Rev.1.00
Page 1400 of 1823
Jul 31, 2019
RX23W Group
38. Serial Peripheral Interface (RSPIa)
(c) Flow of Error Processing
In slave operation, even when a mode fault error is generated, the SPSR.MODF flag can be cleared regardless of the
status of the SSLA0 pin.
When interrupts are used and an error occurs, if the ICU.IRn.IR flag for the SPTI or SPRI interrupt request is set to 1,
clear the ICU.IRn.IR flag in the error processing routine. If the SPRI interrupt request is indicated, read the receive buffer
and initialize the sequencer in the RSPI.
Figure 38.42
Flowchart for Slave Mode (Error Processing)
Set SPCR.SPE = 1 and set bits
SPTIE, SPRIE, and SPEIE
Proceed to
processing for
transmission
Proceed to
processing for
reception
Proceed to
error
processing
[3] Set the SPE bit to “enabled”.
Enable the required interrupts at the
same time (Disables the related
interrupt when using a polling).
Clear the SPSR.MODF, OVRF,
and PERF flags
End of initial settings
Pre-transfer processing
[1] Clear error sources.
Set SPCR2.SPIIE = 0
[2] Disable SPII interrupts.
Error processing
Start error
processing
SPEI interrupt?
Yes
No
SPSR.MODF = 0
Yes
SPCR.SPE = 0
No
Error processing
Repeat the transfer processing
End of error
processing
[4] Clear the ICU.IRn.IR flag
corresponding to SPTI, SPRI, etc.
Set SPCR.SPTIE = 0,
SPRIE = 0, SPEIE = 0,
and SPCR2.SPIIE = 0
Clear the SPSR.MODF, OVRF,
and PERF flags
[5] Run the initialization processing again, etc.
[4]
The order of processing can be changed.