RX610 Group
20. Serial Communications Interface (SCI)
R01UH0032EJ0120 Rev.1.20
Page 645 of 1006
Feb 20, 2013
20.3.4
SCI Initialization (Asynchronous Mode)
Before transmitting and receiving data, start by writing the initial value "00h" to the SCR and then continue through the
procedure for SCI given in the sample flowchart (figure 20.7). Whenever the operating mode or transfer format is
changed, the SCR must be initialized before the change is made.
When the external clock is used in asynchronous mode, ensure that the clock signal is supplied even during initialization.
Note that clearing the SCR.RE bit to 0 initializes neither the ORER, FER, and PER flags in SSR nor RDR.
Moreover, note that switching the value of the SCR.TE bit from 1 to 0 or 0 to 1 while the SCR.TIE bit is 1 leads to the
generation of a TXI interrupt request.
Wait
Start initialization
[ 1 ]
No
Yes
Clear bits TIE, RIE, TE, RE, and TEIE
in SCR to 0
1-bit interval elapsed
[ 1 ]
Set the Bi bit in ICR of Pn for the corresponding pin
to 1 (input buffer of the corresponding pin is
enabled) when receiving data or using an external
clock.
[ 2 ]
Set the clock selection in SCR.
When the clock output is selected in asynchronous
mode, the clock is output immediately after SCR
settings are made.
[ 3 ]
Set the data transfer format in SMR and SCMR*
1
.
[ 4 ]
Write a value corresponding to the bit rate to BRR.
This step is not necessary if an external clock is
used.
[ 5 ]
Wait at least one bit interval, then set the TE bit or
RE bit in SCR to 1. Also set the SCR.TIE,
SCR.RIE, and SCR.TEIE bits.*
2
Setting the TE and RE bits enables the TxDn and
RxDn pins to be used.
Set Bi bit in ICR of Pn to 1
Set bits CKE[1:0] in SCR
[ 2 ]
[ 3 ]
[ 4 ]
[ 5 ]
Set data transfer format in
SMR and SCMR
Set a value in BRR
Set TE or RE bit in SCR to 1, and set TIE,
RIE, and TEIE bits in SCR
Initialization completion
Note 1. Set the SCMR register to its initial value.
Note 2. If both the TIE and TEIE bits are set to 1 when a TXI
interrupt starts up the DMAC or DTC, a TEI interrupt
during transfer by the DMAC or DTC will be generated as
a CPU interrupt. After all of the transfer by the DMAC or
DTC is completed, set the TEIE bit to 1.
Figure 20.7 Sample SCI Initialization Flowchart (Asynchronous Mode)