RX610 Group
20. Serial Communications Interface (SCI)
R01UH0032EJ0120 Rev.1.20
Page 665 of 1006
Feb 20, 2013
20.5.5
Initialization of the SCI
Before transmitting and receiving data, initialize the SCI using the following procedure. Initialization is also necessary
before switching from transmission to reception and vice versa.
1. Write the initial value "00h" to the SCR.
2. Set the Bj bit (j = 0 to 7) in ICR of Pm (m = 0 to 9, A to E) of the corresponding pin to 1.
3. Set the error flags ORER, ERS, and PER in SSR to 0.
4. Set bits GM, BLK, OE, BCP[1:0], and CKS[1:0] in SMR and the BCP2 bit in SCMR appropriately. Also set the PE
bit in SMR to 1.
5. Set bits SDIR, SINV, and SMIF in SCMR appropriately. Also set the Bj bit in DDR of Pm corresponding to the
TxDn pin to 0. Then the TxDn and RxDn pins are changed from port pins to SCI pins, placing the pins into high
impedance state.
6. Set the value corresponding to the bit rate in BRR.
7. Set the CKE[1:0] bits in SCR appropriately, and set bits TIE, RIE, TE, RE, and TEIE in SCR to 0 at the same time.
When the CKE0 bit is set to 1, the SCKn pin is allowed to output clock pulses.
8. Wait for at least a 1-bit interval, and then set the TIE, RIE, TE, and RE bits in SCR. Setting the TE and RE bits to 1
simultaneously is prohibited except for self diagnosis.
To change reception mode to transmission mode, first check that reception has completed, and then initialize the SCI. At
the end of initialization, set TE = 1 and RE = 0. Reception completion can be verified by reading the RXI request, ORER,
or PER flag in SSR.
To change transmission mode to reception mode, first check that transmission has completed, and then initialize the SCI.
At the end of initialization, set TE = 0 and RE = 1. Transmission completion can be verified by reading the SSR.TEND
flag.