Universal synchronous asynchronous receiver transmitter (USART)
Selecting the clock source and the proper oversampling method
The choice of the clock source is done through the Clock Control system (see the Reset and
clock control (RCC) section). The clock source must be chosen before enabling the USART
(by setting the UE bit).
The choice of the clock source must be done according to two criteria:
●
Possible use of the USART in low power mode
●
Communication speed
The clock source frequency is f
When the dual clock domain and the wakeup from Stop mode features are supported, the
clock source can be one of the following sources: f
Otherwise, the USART clock source is f
Choosing f
in low power mode. Depending on the received data and wakeup mode selection, the
USART wakes up the MCU, when needed, in order to transfer the received data by software
reading the USART_RDR register or by DMA.
For the other clock sources, the system must be active in order to allow USART
communication.
The communication speed range (specially the maximum communication speed) is also
determined by the clock source.
The receiver implements different user-configurable oversampling techniques (except in
synchronous mode) for data recovery by discriminating between valid incoming data and
noise. This allows a trade of between the maximum communication speed and noise/clock
inaccuracy immunity.
The oversampling method can be selected by programming the OVER8 bit in the
USART_CR1 register and can be either 16 or 8 times the baud rate clock
Figure
234).
Depending on the application:
●
Select oversampling by 8 (OVER8=1) to achieve higher speed (up to f
the maximum receiver tolerance to clock deviation is reduced (refer to
Tolerance of the USART receiver to clock deviation on page
●
Select oversampling by 16 (OVER8=0) to increase the tolerance of the receiver to clock
deviations. In this case, the maximum speed is limited to maximum f
,where f
CK
Programming the ONEBIT bit in the USART_CR3 register selects the method used to
evaluate the logic level. There are two options:
●
The majority vote of the three samples in the center of the received bit. In this case,
when the 3 samples used for the majority vote are not equal, the NF bit is set
●
A single sample in the center of the received bit
Depending on the application:
–
–
582/742
, f
as clock source may allow the USART to receive data while the MCU is
LSE
HSI
is the clock source frequency.
select the three samples' majority vote method (ONEBIT=0) when operating in a
noisy environment and reject the data when a noise is detected (refer to
because this indicates that a glitch occurred during the sampling.
select the single sample method (ONEBIT=1) when the line is noise-free to
increase the receiver's tolerance to clock deviations (see
Doc ID 018940 Rev 1
.
CK
PCLK
PCLK .
(default), f
, f
or f
LSE
HSI
(Figure 233
/8). In this case
CK
Section 25.5.5:
587)
/16
CK
Section 25.5.5:
RM0091
.
SYS
and
Figure
84)
Need help?
Do you have a question about the STM32F05 series and is the answer not in the manual?
Questions and answers