Hitachi H8S/2199 Hardware Manual page 440

Single-chip microcomputer
Table of Contents

Advertisement

 Serial Data Reception (Asynchronous Mode)
Figures 22.7 and 22.8 show sample flowcharts 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 22.7 Sample Serial Reception Data Flowchart (1)
[1]
[2]
Yes
No
Error handling
(Continued on next page)
[4]
Yes
[5]
Yes
SCI initialization:
[1]
The SI1 pin is automatically designated as
the receive data input pin.
Receive error handling and break
[2][3]
detection:
If a receive error occurs, read the ORER,
PER, and FER flags in SSR to identify the
error. After performing the appropriate
error handling, ensure that the PERE, 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.
SCI status check and receive data read:
[4]
Read SSR 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. 1.0, 02/00, page 431 of 1141

Advertisement

Table of Contents
loading

Table of Contents