RM0008 Universal synchronous asynchronous receiver transmitter (USART)
617/690
When no transmission is taking place, a write instruction to the USART_DR register places
the data directly in the shift register, the data transmission starts, and the TXE bit is
immediately set.
When a frame transmission is complete (after the stop bit) the TC bit is set and an interrupt
is generated if the TCIE is set in the USART_CR1 register.
Clearing the TC bit is performed by the following software sequence:
1. A read to the USART_SR register
2. A write to the USART_DR register
Note: The TC bit can also be cleared by writing a ‘0’ to it. This clearing sequence is recommended
only for Multibuffer communication.
Break characters
Setting the SBK bit transmits a break character. The break frame length depends on the M
bit (see Figure 238).
If the SBK bit is set to ‘1’ a break character is sent on the TX line after completing the current
character transmission. This bit is reset by hardware when the break character is completed
(during the stop bit of the break character). The USART inserts a logic 1 bit at the end of the
last break frame to guarantee the recognition of the start bit of the next frame.
Note: If the software resets the SBK bit before the commencement of break transmission, the
break character will not be transmitted. For two consecutive breaks, the SBK bit should be
set after the stop bit of the previous break.
Idle characters
Setting the TE bit drives the USART to send an idle frame before the first data frame.
24.3.3 Receiver
The USART can receive data words of either 8 or 9 bits depending on the M bit in the
USART_CR1 register.
Start bit detection
In the USART, the start bit is detected when a specific sequence of samples is recognized.
This sequence is: 1 1 1 0 X 0 X 0X 0X 0 X 0X 0.