Auto Baud Rate Detection - STMicroelectronics STM32F05 series Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Universal synchronous asynchronous receiver transmitter (USART)
Table 87.
M bit
Note:
The data specified in
received frames contain some Idle frames of exactly 10-bit times when M=0 (11-bit times
when M=1).
25.5.6

Auto baud rate detection

The USART is able to detect and automatically set the USART_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
(oversampling by 16 selected and baudrate between f
Before activating the auto baud rate detection, the character pattern must be chosen. There
are two possible character patterns, which can be chosen through the ABRMOD[1:0] field in
the USART_CR2 register. These patterns are:
1.
Any character starting with a bit at 1. In this case the USART will measure the duration
of the Start bit (falling edge to rising edge).
2.
Any character starting with a 10xx bit pattern. In this case, the USART will measure the
duration of the Start and of the 1st data bit. The measure is done falling edge to falling
edge, ensuring a better accuracy in the case of slow signal slopes.
In addition, prior to activating auto baud rate detection, the USART_BRR register must be
initialized by writing a non-zero baud rate value.
The automatic baud rate detection is activated by setting the ABREN bit in the USART_CR2
register. The USART will then wait for the first character on the RX line. The auto baud rate
operation completion is indicated by the setting of the ABRF flag in the USART_ISR register.
If the line is noisy, the correct baud rate detection cannot be guaranteed. In this case the
BRR value may be corrupted and/or the ABRE error flag may be set. This also happens if
the communication speed is not compatible with the automatic baud rate detection range
(bit duration not between 16 to 65536 clock periods).
The RXNE interrupt will signal the end of the operation.
At any later time, the auto baud rate detection may be relaunched by resetting the ABRF
flag (by writing a 0).
If the USART is disabled (UE=0) during an auto baud rate operation, the BRR value may be
corrupted.
588/742
Tolerance of the USART receiver when BRR[3:0]
is different from 0000
ONEBIT=0
0
3.33%
1
3.03%
Table 86
and
Doc ID 018940 Rev 1
OVER8 bit = 0
ONEBIT=1
3.88%
3.53%
Table 87
may slightly differ in the special case when the
OVER8 bit = 1
ONEBIT=0
2%
1.82%
/65535 and f
/16).
CK
CK
RM0091
ONEBIT=1
3%
2.73%

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F05 series and is the answer not in the manual?

Questions and answers

Table of Contents