2025-10-07 2:26 AM
So I am reading the RM0008 Reference manual because I need to describe some limits for my system
I am looking for the UARTs tolerance of clock drift
on page 800 I am confused by these tables:
In my case DIV_FRACTION is different from 0 and the M bit is 0
The way I read the table... the Noise Flag triggers as an error if there is more than 3.33% clock drift...
but... it does not care if there is 3.88%...
This makes no sense so... am I misunderstanding something or?
Link to the document in question:
https://www.st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
2025-10-07 3:20 AM
I guess you have to spend some time and recall the basic of UARTs.
All real word signals are analog and a trigger transforms the same to digital - therefore rise time and fall time play a great role in when signals get in digital domain.
Once they are digital, they are oversampled - see pag 974 - and the oversampling is vital to increase or decrease tolerance to clocks speed.
As the picture in manual shows, decision is between count a and count b to recover the length of a baud and decide if it is a 0 or a 1.
On top, you have clocks - tx and rx - that must have some tolerance to allow a system to sample and decode the sampled stream; but unless you first define how is your system and ahoe is usart setup, it is very difficult to talk of tolerances in absolute terms.
At last, you come to the table, that shows that if you decide that noise is a problem, will reduce tolerance, same with fractional div that generates an asymmetric clock adding quantization noise to signal.
mike
2025-10-07 3:28 AM
Yes, you are misunderstanding the meaning of the numbers in the table.
if YOU don't care about NF, then the allowed clock difference between the transmitter and receiver is 3.88. If YOU require NF flag check, then it's 3.33%.
Basically, with the default 16x oversampling, single-side clock deviation should not exceed 2%. It's not about the details of STM32 UART - it's common sense. Total frame transfer time difference between RX and TX must be less than half of bit time slice.