Hitachi H8/3032 Series Hardware Manual page 376

Table of Contents

Advertisement

Downloaded from
Elcodis.com
electronic components distributor
Receiving Serial Data: Figure 11-18 shows a sample flowchart for receiving serial data and
indicates the procedure to follow. When switching from asynchronous mode to synchronous
mode, make sure that the ORER, PER, and FER flags are cleared to 0. If the FER or PER flag is
set to 1 the RDRF flag will not be set and both transmitting and receiving will be disabled.
Initialize
Start receiving
Read ORER flag in SSR
ORER = 1?
No
Read RDRF flag in SSR
No
RDRF = 1?
Yes
Read receive data
from RDR, and clear
RDRF flag to 0 in SSR
No
Finished
receiving?
Yes
Clear RE bit to 0 in SCR
End
Figure 11-18 Sample Flowchart for Serial Receiving (1)
1
1.
SCI initialization: the receive data function of
the RxD pin is selected automatically.
2., 3.
Receive error handling: if a receive error
occurs, read the ORER flag in SSR, then after
executing the necessary error handling, clear
the ORER flag to 0. Neither transmitting nor
receiving can resume while the ORER flag
2
remains set to 1.
4.
SCI status check and receive data read: read
SSR, check that the RDRF flag is set to 1,
Yes
then read receive data from RDR and clear
3
the RDRF flag to 0. Notification that the RDRF
flag has changed from 0 to 1 can also be
Error handling
given by the RXI interrupt.
5.
To continue receiving serial data: check the
4
RDRF flag, read RDR, and clear the RDRF
flag to 0 before the MSB (bit 7) of the current
frame is received.
5
361

Advertisement

Table of Contents
loading

Table of Contents