Hardware manual
Rev. 3.0, 09/98, page 219 of 361
(2) Transmitting and Receiving Data
•
SCI Initialization: The SCI must be initialized in the same way as in asynchronous mode.
See figure 10.4. When switching from asynchronous mode to clocked synchronous mode,
check that the ORER, FER, and PER bits are cleared to “0.” Transmitting and receiving
cannot begin if ORER, FER, or PER is set to “1.”
•
Transmitting Serial Data: Follow the procedure below for transmitting serial data.
Start transmitting
Read TDRE bit in SSR
TDRE = "1"?
Write transmit data in
TDR and clear TDRE bit to
"0" in SSR
End of
transmission?
End
1
2
3
No
Yes
No
Yes
SCI initialization: the transmit data output function of the TxD pin is
selected automatically.
SCI status check and transmit data write: read the serial status
register (SSR), check that the TDRE bit is "1," then write transmit
data in the transmit data register (TDR) and clear TDRE to "0."
Transition of the TDRE bit from "0" to "1" can be reported by a
TXI interrupt.
To continue transmitting serial data: read the TDRE bit to check
whether it is safe to write; if TDRE = "1," write data in TDR, then
clear TDRE to "0."
To end serial transmission: end of transmission can be confirmed
by checking transition of the TEND bit from "0" to "1." This can be
reported by a TEI interrupt.
(a)
(b)
Read TEND bit in SSR
TEND = "1"?
No
Yes
1.
2.
3.
Initialize
Clear TE bit to "0" in SCR
Serial transmission
Figure 10.13 Sample Flowchart for Serial Transmitting
In transmitting serial data, the SCI operates as follows.
1. The SCI monitors the TDRE bit in SSR. When TDRE is cleared to “0” the SCI recognizes that
the transmit data register (TDR) contains new data, and loads this data from TDR into the
transmit shift register (TSR).