Datasheet

Table Of Contents
Section 18 Serial Communication Interface 4 (SCI4)
Rev. 2.00 Jul. 04, 2007 Page 428 of 692
REJ09B0309-0200
18.4.6 Simultaneous Data Transmission and Reception
Figure 18.8 shows an example flowchart of simultaneous data transmission and reception.
Simultaneous data transmission and reception should be performed as the following procedure
after the SCI4 initialization.
Read TDRE in SCSR4
TDRE = 1?
Write transmit data in TDR4
TDRE bit cleared to 0 automatically
Data transferred from TDR4 to SR4
Start transmission/reception
by setting TDRE bit to 1
ORER = 1?
Read RDRF in SCSR4
RDRF = 1?
Clear TE and RE bits in SCR4 to 0
<Transmission and reception completed>
Note: Hatching area indicates SCI internal operation.
Yes
No
Yes
No
Yes
No
[1] Pin SO4 functions as output pin for transmit
data and pin SI4 functions as input pin for
receive data. Simultaneous transmission and
reception is enabled.
[2] After reading SCSR4 and confirming TDRE
= 1, write transmit data in TDR4. Writing data
in TDR4 clears the TDRE bit to 0 automati-
cally. At this time, the clock is output to start
data transfer.
[3] When a reception error occurs, read the ORER
flag in SCSR4 and then clear the ORER flag
to 0 after executing the error processing. When
the ORER flag is set to 1, both transmission
and reception cannot be restarted.
[4] After reading SCSR4 and confirming RDRF = 1,
read receive data in RDR4 and clear the RDRF
flag to 0. An RXI interrupt can also be used to
confirm that the RDRF flag value has been changed
from 0 to 1.
[5] To consecutively transmit and receive data, the
following operation must be completed: reading
the RDRF flag and reading RDR4 before receiving
the MSB (bit 7) of the current frame: confirming
that TDR4 is ready for writing by reading TDRE
= 1 before transmitting the MSB (bit 7) and writing
data to TDR4 to clear the TDRE flag to 0.
[1]
[2]
Initialization
Start transmission (TE = 1, RE = 1)
Read received data in RDR4
Data transfer will
continue?
Yes
No
RDRF cleared to 0 automatically
Error
processing
[3]
Read ORER in SCSR4
[4]
[5]
Figure 18.8 Flowchart Example of Simultaneous Transmission and Reception