Renesas Hitachi H8S/2194 Series Hardware Manual page 502

16-bit single-chip microcomputer
Table of Contents

Advertisement

(c) Serial Data Reception (Asynchronous Mode)
Figure 23.7 shows a sample flowchart for serial reception.
The following procedure should be used for serial data reception.
Initialization
Start reception
Read ORER, PER,
FER flags in SSR1
PER FER ORER=1
Read RDRF flag in SSR1
No
RDRF=1
Read receive data in RDR1, and clear
RDRF flag in SSR1 to 0
No
All data received?
Clear RE bit in SCR1 to 0
< End >
Figure 23.7 Sample Serial Reception Data Flowchart (1)
[1]
[2]
Yes
No
Error handling
(Continued on next page)
[4]
Yes
[5]
Yes
[1]
SCI1 initialization:
The SI1 pin is automatically designated as
the receive data input pin.
[2][3]
Receive error handling and break
detection:
If a receive error occurs, read the ORER,
PER, and FER flags in SSR1 to identify the
error. After performing the appropriate
error handling, ensure that the ORER,
PER, and FER flags are all cleared to 0.
Reception cannot be resumed if any of
these flags are set to 1. In the case of a
[3]
framing error, a break can be detected by
reading the value of the input port
corresponding to the SI1 pin.
SCI1 status check and receive data read:
[4]
Read SSR1 and check that RDRF = 1, then
read the receive data in RDR1 and clear
the RDRF flag to 0. Transition of the RDRF
flag from 0 to 1 can also be identified by an
RXI interrupt.
Serial reception continuation procedure:
[5]
To continue serial reception, before the
stop bit for the current frame is received,
read the RDRF flag, read RDR1, and clear
the RDRF flag to 0.
Rev. 2.0, 11/00, page 475 of 1037

Advertisement

Table of Contents
loading

Table of Contents