Sci Initialization (Smart Card Interface Mode) - Renesas RX100 Series User Manual

32-bit mcu
Hide thumbs Also See for RX100 Series:
Table of Contents

Advertisement

RX13T Group
23.6.5

SCI Initialization (Smart Card Interface Mode)

Initialize the SCI following the example of flowchart shown in Figure 23.37 .
Initialize the SCR and SSR registers before switching from transmit mode to receive mode and vice versa. When not
changing the bit rate, it is not necessary to set the CKE[1:0] bits to 00b. Even if the RE bit is set to 0, the RDR register is
not initialized.
To change receive mode to transmit mode, first check that reception has completed, and then execute steps [1] and [3] in
Figure 23.37 . Set TE = 1 and RE = 0 at step [11]. Reception completion can be verified by reading the RXI request,
SSR.ORER, or SSR.PER flag.
To change transmit mode to receive mode, first check that transmission has completed, and then execute steps [1] and [3]
in Figure 23.37 . Set TE = 0 and RE = 1 at step [11]. Transmission completion can be verified by reading the SSR.TEND
flag.
Start
Set the SCR register to 00h
Set the SIMR1.IICM bit to 0, and
set the SCMR.SMIF bit to 1
Set the SSR.ORER, ERS, and PER flags
to 0
Set the SPMR register to 00h
Set the SMR.GM, BLK, PM, BCP[1:0], and
CKS[1:0] bits, and set the SMR.PE bit to 1
Set the SCMR.BCP2, SDIR, and SINV bits
Set the SEMR register to 00h
Set the BRR register
Set the pin functions
(set the MPC and I/O port)
Set the SCR.CKE[1:0] bits
Set the SCR.TE, RE, TIE, and RIE bits
End
Figure 23.37
Example of SCI Initialization Flowchart (Smart Card Interface Mode)
R01UH0822EJ0100 Rev.1.00
Jul 31, 2019
23. Serial Communications Interface (SCIg, SCIh)
[ 1 ]
Set the SCR register to 00h to stop transmission and reception.
[ 1 ]
[ 2 ]
Set the SIMR1.IICM bit to 0 and the SCMR.SMIF bit to 1 for
setting the SCI to smart card interface mode.
[ 2 ]
[ 3 ]
Clear the SSR.ORER, ERS, and PER flags.
After reading the SSR register, write C0h in the register.
[ 3 ]
[ 4 ]
Set the SPMR register to 00h.
[ 5 ]
Set the operating mode and transmission and reception format in
[ 4 ]
the SMR register.
[ 6 ]
Set the transmission and reception format in the SCMR register.
[ 5 ]
Do not change the SMIF bit.
[ 7 ]
Set the SEMR.BRME and RXDESEL bits 0. Set the other bits in
[ 6 ]
the SEMR register to 0.
[ 8 ]
Set the value corresponding to the bit rate in the BRR register.
[ 7 ]
[ 9 ]
Set the PxyPFS and PMR registers so that the necessary pin
[ 8 ]
functions among the TXDn, RXDn, and SCKn pins can be
enabled.
The TXDn, RXDn, and SCKn pins become high-impedance.
[ 9 ]
[ 10 ] Set the SCR.CKE[1:0] bits.
When the CKE[0] bit is set to 1, the clock is output from the SCKn
[ 10 ]
pin.
[ 11 ] Set either the SCR.TE or RE bit to 1.
[ 11 ]
Do not set both the TE and RE bits to 1 except for self-diagnosis.
Set the TIE and RIE bits if necessary.
Page 671 of 1041

Advertisement

Table of Contents
loading

Table of Contents