Hardware manual

Rev. 3.0, 09/98, page 221 of 361
Start receiving
Read RDRF bit in SSR
RDRF = "1"?
Read receive data
from RDR, and clear
RDRF bit to "0" in SSR
ORER = "1"?
Read ORER in SSR
Finished
receiving?
Clear RE to "0" in SCR
End
Error handling
1
2
3
No
Yes
Yes
No
No
Yes
4
1.
2.
3.
4.
SCI initialization: the receive data function of the RxD pin is
selected automatically.
SCI status check and receive data read: read the serial status
register (SSR), check that RDRF is set to "1," then read receive
data from the receive data register (RDR) and clear RDRF to "0."
Transition of the RDRF bit from "0" to "1" can be reported by an
RXI interrupt.
To continue receiving serial data: read RDR and clear RDRF to
"0" before the MSB (bit 7) of the current frame is received.
Receive error handling: if a receive error occurs, read the ORER
bit in SSR then, after executing the necessary error handling,
clear ORER to "0." Neither transmitting nor receiving can
resume while ORER remains set to "1." When clock output
mode is selected, receiving can be halted temporarily by
receiving one dummy byte and causing an overrun error.
When preparations to receive the next data are completed, clear
the ORER bit to "0." This causes receiving to resume, so
return to the step marked 2 in the flowchart.
Clear ORER to "0" in SSR
Return
Overrun error handling
Start error handling
Initialize
Figure 10.15 Sample Flowchart for Serial Receiving
In receiving, the SCI operates as follows.
1. If an external clock is selected, data are input in synchronization with the input clock. If clock
output is selected, as soon as the RE bit is set to “1” the SCI begins outputting the serial clock
and inputting data. If clock output is stopped because the ORER bit is set to “1,” output of the
serial clock and input of data resume as soon as the ORER bit is cleared to “0.”
2. Receive data are shifted into RSR in order from LSB to MSB.