13 UART (UART3)
S1C31D50/D51 TECHNICAL MANUAL
Seiko Epson Corporation
13-5
(Rev. 2.00)
13.5.2 Data Transmission
A data sending procedure and the UART3 Ch.
n
operations are shown below. Figures 13.5.2.1 and 13.5.2.2 show a
timing chart and a flowchart, respectively.
Data sending procedure
1. Check to see if the UART3_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
2. Write transmit data to the UART3_
n
TXD register.
3. Wait for a UART3 interrupt when using the interrupt.
4. Repeat Steps 1 to 3 (or 1 and 2) until the end of transmit data.
UART3 data sending operations
The UART3 Ch.
n
starts data sending operations when transmit data is written to the UART3_
n
TXD register.
The transmit data in the UART3_
n
TXD register is automatically transferred to the shift register and the
UART3_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
The USOUT
n
pin outputs a start bit and the UART3_
n
INTF.TBSY bit is set to 1 (transmit busy). The shift reg-
ister data bits are then output successively from the LSB. Following output of MSB, the parity bit (if parity is
enabled) and the stop bit are output.
Even if transmit data is being output from the USOUT
n
pin, the next transmit data can be written to the
UART3_
n
TXD register after making sure the UART3_
n
INTF.TBEIF bit is set to 1.
If no transmit data remains in the UART3_
n
TXD register after the stop bit has been output from the USOUT
n
pin, the UART3_
n
INTF.TBSY bit is cleared to 0 and the UART3_
n
INTF.TENDIF bit is set to 1 (transmission
completed).
USOUTn
UART3_nINTF.TBEIF
UART3_nINTF.TBSY
UART3_nINTF.TENDIF
Software operations
st D0 D1 D2 D3 D4 D5 D6 D7 p sp st D0 D1
D7 p sp
st D0 D1
D7 p sp
(st: start bit, sp: stop bit, p: parity bit)
Data (W)
→
UART3_nTXD
Data (W)
→
UART3_nTXD
1 (W)
→
UART3_nINTF.TENDIF
Data (W)
→
UART3_nTXD
Figure 13.5.2.1 Example of Data Sending Operations
Data transmission
End
Read the UART3_nINTF.TBEIF bit
Write transmit data to
the UART3_nTXD register
YES
NO
NO
YES
Transmit data remained?
UART3_nINTF.TBEIF = 1 ?
Wait for an interrupt request
(UART3_nINTF.TBEIF = 1)
Figure 13.5.2.2 Data Transmission Flowchart