Chapter 13
Serial Interface
XIII - 42 Clock-Synchronous Communication
Initial Setting Before Communication
Step Setting Register name Description
1 Disable interrupt SCnTICR.SCnTIE = 0 Disable the interrupt for SCIFn to be used.
2
Reset <SCIFn (n = 0, 1 )>
SCnMD3.SCnRSTN = 0
<SCIFn (n = 2, 3)>
SCnMD2.SCnRSTN = 0
Reset SCIFn to be used.
3
Pin setting
(Disable serial output)
PnMD Set pins to general-purpose ports.
4
BRTMn setting BRTM_S_MD
BRTM_S_CKSEL
BRTM_S01_CK
BRTM_S23_CK
BRTM_Sn_OC
While BRTMn is active, set BRTM_S_EN.BRTM_Sn_EN to
0 to stop counting.
Output clock cycle and duty for BRTMn are set.
5
Mode register setting SCnMD0
SCnMD1
SCnMD2
SCnMD3
Set SCIFn operation mode.
6
Pin setting
(Enable communication pins)
<SCIFn (n = 0, 1)>
SCnMD1.SCnSBOS
SCnMD1.SCnSBIS
SCnMD1.SCnSBTS
SCnMD3.SCnSBCSEN
<SCIFn (n = 2, 3)>
SCnMD1.SCnSBOS
SCnMD1.SCnSBIS
SCnMD1.SCnSBTS
SCnMD2.SCnSBCSEN
Set pins to be used for serial communication to 1.
7
Pin setting
(Enable serial output)
PnMD Enable communication pins.
8 Clear interrupt source SCnTICR.SCnTIR = 0 Clear the interrupt source.
9 Enable interrupt SCnTICR.SCnTIE To use an interrupt, set SCnTICR.SCnTIE to 1.
10
BRTMm counting start BRTM_S_EN.BRTM_Sn_E
N = 1
BRTM starts counting.
11
Release serial reset <SCIFn (n = 0, 1)>
SCnMD3.SCnRSTN = 1
<SCIFn (n = 2, 3)>
SCnMD2.SCnRSTN = 1
Release the serial reset.
After that, serial communication is enabled.