Chapter 13
Serial Interface
XIII - 44 Clock-Synchronous Communication
Data Reception (1-byte Communication Mode)
Data Transmission/Reception (Consecutive Communication Mode)
Step Setting Register name Description
1
Empty confirmation of transmis-
sion buffer
SCnSTR.SCnTEMP Confirm that SCnSTR1.SCnTEMP is 0.
2
Dummy data write to TXBUFnTX-
BUFn
TXBUFn Set dummy data in TXBUFn.
3
Wait for communication comple-
tion
<SCIFn (n = 0, 1)>
SCnSTR.SCnRBSY
<SCIFn (n = 2, 3)>
SCnSTR.SCnTBSY
<SCIFn (n = 0, 1)>
When the communication has been completed, SCnRBSY
becomes 0.
When an interrupt is enabled, a communication complete
interrupt (SCnTIRQ) occurs.
<SCIFn (n = 2, 3)>
When the communication has been completed, SCnTBSY
becomes 0.
When an interrupt is enabled, a communication complete
interrupt (SCnTIRQ) occurs.
4
Reception data read from
RXBUFn
RXBUFn Read out the reception data from RXBUFn.
5
Confirmation of overrun error <SCIFn (n = 0, 1)>
SCnSTR.SCnORE
SCnSTR.SCnERE
<SCIFn (n = 2, 3)>
SCnSTR.SCnORE
If SCnORE/SCnERE(*) is 1, it indicates an overrun error has
occurred. When an overrun error has occurred, take mea-
sures, such as data retransmission, since reception data may
be destroyed.
(*) SCnERE is only for SCIFn (n = 0, 1).
6
Reception end - Repeat these procedures from step 1 to execute the next
communication.
Step Setting Register name Description
1
Empty confirmation of transmis-
sion buffer
SCnSTR.SCnTEMP Confirm that SCnSTR1.SCnTEMP is 0.
2
Data write to TXBUFn
(The first data transmission)
TXBUFn Set transmission data in TXBUFn.
3
Empty confirmation of transmis-
sion buffer
SCnSTR.SCnTEMP Confirm that SCnSTR.SCnTEMP becomes 0 since communica-
tion starts.
4
Data write to TXBUFn
(The second and subsequent
data transmission)
TXBUFn Set the next transmission data in TXBUFn.
5
Wait for communication comple-
tion
SCnSTR.SCnREMP When reception data are stored in RXBUFn,
SCnSTR.SCnREMP is set to 1.
When an interrupt is enabled, a communication complete inter-
rupt (SCnTIRQ) occurs.
6
Reception data read from
RXBUFn
RXBUFn Read out the reception data from RXBUFn.
7
Confirmation of overrun error <SCIFn (n = 0, 1)>
SCnSTR.SCnORE
SCnSTR.SCnERE
<SCIFn (n = 2, 3)>
SCnSTR.SCnORE
If SCnORE/SCnERE(*) is 1, it indicates an overrun error has
occurred. When an overrun error has occurred, take measures,
such as data retransmission, since reception data may be
destroyed.
(*) SCnERE is only for SCIFn (n = 0, 1).
8
Consecutive communication or
not
- When continuing data transmission, repeat procedures from
step 3.
When completing data transmission, go to step 9.
9
Transmission/reception end - After the operations from step 5 to step7 are executed, the com-
munication is completed since data reception to be set in step 4
has not been completed.
Repeat these procedures from step 1 to execute the next com-
munication