
318
CHAPTER 13 UART
13.4.1 Asynchronous Modes
The UART can handle data only in nonreturn-to-zero (NRZ) format.
Items of transfer data always start from the start bit ("L" level data). Data items with
the length specified by LSB first are transferred. The transfer data ends with the stop
bit ("H" level data). If an external clock has been selected, always input the clock
signal.
s Transfer Data Format in Asynchronous Modes
Figure 13.4-1 "Format of Transferred Data Format in Asynchronous Modes (Modes 0 and 1)"
shows the format of transferred data in the asynchronous modes.
In asynchronous normal mode (mode 0), the data length can be set to seven or eight bits. In
asynchronous multiprocessor mode (mode 1), the data length must be eight bits. A parity bit
cannot be added in asynchronous multiprocessor mode, but an A/D bit must be added.
Figure 13.4-1 Format of Transferred Data Format in Asynchronous Modes (Modes 0 and 1)
r Receiving
If the SCR register RXE bit (bit 1) is "1", reception is performed.
When the start bit is detected on the receiving line, one data frame in the format determined by
the SCR register is received. If an error occurs after one data frame has been received, an
error flag will be set and the RDRF flag (SSR register bit 4) will be set subsequently. If the RIE
bit (bit 1) of the same SSR register has been set to 1 at this time, a receiver interrupt for the
CPU will be thrown. Check each flag of the SSR register. If reception is normal, read the SIDR
register. If an error has occurred, respond accordingly.
The RDRF flag will be cleared when the SIDR register is read.
r Sending
When the SSR register TDRE flag (bit 11) is "1", the send data will be written to the SODR
register and the data is sent if the SCR register TXE flag (bit 0) is "1".
When the data set in the SODR register is loaded to the sending shift register and sending
starts, the TDRE flag will be set again so that the next item of sending data can be set. If the
TIE bit (bit 0) of the same SSR register has been set to 1 at this time, a transmitter interrupt for
the CPU will be thrown. A request will then be issued to set the send data in the SODR register.
The TDRE flag will be cleared as soon as the send data is set in the SODR register.
SI,SO
Start LSB
MSB Stop
A/D Stop
01001101B
(Mode 0)
(Mode 1)
The transferred data is
00
0
11
1