RM0351
Table 195. Tolerance of the USART receiver when BRR [3:0] is different from 0000
M bits
00
01
10
Note:
The data specified in
the received frames contain some Idle frames of exactly 10-bit durations when M bits = 00
(11-bit durations when M bits =01 or 9- bit durations when M bits = 10).
36.5.6
USART auto baud rate detection
The USART is able to detect and automatically set the USARTx_BRR register value based
on the reception of one character. Automatic baud rate detection is useful under two
circumstances:
•
The communication speed of the system is not known in advance
•
The system is using a relatively low accuracy clock source and this mechanism allows
the correct baud rate to be obtained without measuring the clock deviation.
The clock source frequency must be compatible with the expected communication speed
(when oversampling by 16, the baud rate is between f
oversampling by 8, the baudrate is between f
Before activating the auto baud rate detection, the auto baud rate detection mode must be
chosen. There are various modes based on different character patterns.
They can be chosen through the ABRMOD[1:0] field in the USARTx_CR2 register. In these
auto baud rate modes, the baud rate is measured several times during the synchronization
data reception and each measurement is compared to the previous one.
These modes are:
•
Mode 0: Any character starting with a bit at 1. In this case the USART measures the
duration of the Start bit (falling edge to rising edge).
•
Mode 1: Any character starting with a 10xx bit pattern. In this case, the USART
measures the duration of the Start and of the 1st data bit. The measurement is done
falling edge to falling edge, ensuring better accuracy in the case of slow signal slopes.
•
Mode 2: A 0x7F character frame (it may be a 0x7F character in LSB first mode or a
0xFE in MSB first mode). In this case, the baudrate is updated first at the end of the
start bit (BRs), then at the end of bit 6 (based on the measurement done from falling
edge to falling edge: BR6). Bit 0 to bit 6 are sampled at BRs while further bits of the
character are sampled at BR6.
•
Mode 3: A 0x55 character frame. In this case, the baudrate is updated first at the end
of the start bit (BRs), then at the end of bit 0 (based on the measurement done from
falling edge to falling edge: BR0), and finally at the end of bit 6 (BR6). Bit 0 is sampled
Universal synchronous asynchronous receiver transmitter (USART)
OVER8 bit = 0
ONEBIT=0
ONEBIT=1
3.33%
3.03%
3.7%
Table 194
and
Table 195
DocID024597 Rev 3
ONEBIT=0
3.88%
2%
3.53%
1.82%
4.31%
2.22%
may slightly differ in the special case when
/65535 and f
CK
/65535 and f
/8).
CK
CK
OVER8 bit = 1
ONEBIT=1
3%
2.73%
3.33%
/16. when
CK
1197/1693
1282
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers