
AT32F413
Series Reference Manual
2022.06.27
Page 149
Rev 2.00
on the TX pin in LSB mode. The output format depends on the programmed frame format.
If synchronous transfer or clock output is selected, the clock pulse is output on the CK pin. If the hardware
flow control is selected, the control signal is input on the CTS pin.
Note: 1. The TEN bit cannot be reset during data transfer, or the data on the TX pin will be
corrupted.
2. After the TEN bit is enabled, the USART will automatically send an idle frame.
12.7.2 Transmitter configuration
1. USART enable: Set the UEN bit.
2. Full-duplex/half-duplex configuration: Refer to
12.2 Full-duplex/half-duplex selector
3. Mode configuration: Refer to
4. Frame format configuration: Refer to
12.4 USART frame format and configuration
5. Interrupt configuration: Refer to
6. DMA transmission configuration: If the DMA mode is selected, the DMATEN bit (bit 3 in the
USART_CTRL3register) is set, and configure DMA register accordingly.
7. Baud rate configuration: Refer to
8. Transmitter enable: When the TEN bit is set, the USART transmitter will send an idle frame.
9. Write operation: Wait unitl the TDBE bit is set, the data to be transferred will be loaded into the
USART_DT register (This operatin will clear the TDBE bit). Repeat this step in non-DMA mode.
10. After the last data expected to be transferred is written, wait until the TDC is set, indicating the end
of transfer. The USART cannot be disabled before the flag is set, or transfer error will occur.
11. When TDC=1, read access to the USART_STS register and write access to the USART_DT
register will clear the TDC bit; This bit can also be cleared by writing “0”, but this is valid only in
DMA mode.
Figure 12-5 TDC/TDBE behavior when transmitting
TDBE
USART_DT
DATA0
DATA1
DATA2
TX pin
TDC
TEN
Set by hardware
Set by hardware
Set by hardware
Set by hardware
Cleared by software
Idle frame
frame0
frame1
frame2
12.8 Receiver
12.8.1 Receiver introduction
USART receiver has its individual REN control bit (bit 2 in the USART_CTRL1 register). The
transmitter and receiver share the same baud rate that is programmable. There is a receive data buffer
(RDR) and a receive shift register in the USART.
The data is input on the RX pin of the USART. When a valid start bit is detected, the receiver ports the
data received into the receive shift register in LSB mode. After a full data frame is received, based on
the programmed frame format, it will be moved from the receive shift register to the receive data buffer,