2025-01-20 7:05 AM - last edited on 2025-01-20 7:29 AM by Andrew Neil
Good morning community,
I am using the STM32L496QGI6 for a certain application using the uart to send and receive messages, in this case it always gives me symbols even with the baudrate correctly configured, I have checked the clock configuration and it is correct for 80Mhz but when checking by means of a 70ms pulse on any pin it tends to have a phase shift of almost 10%, the SYS has been configured with the TIM3, what is the cause of this phase shift, how can I correct it? I have tested the same configuration with an STM32L476 and everything works correctly.
Solved! Go to Solution.
2025-01-21 11:07 AM
Thank you very much for the answers, they were very useful. I checked the configuration. A new project was initialized from scratch to see what was affecting it. I reconfigured the clock but with HSI and within the RCC configuration the HSI calibration parameter at 64 worked correctly. It was 16 before, but now I have some doubts about this value with respect to what is selected, how does it affect the offset? and how does it work internally?
2025-01-20 7:34 AM
You're running from internal RC oscillators - that's never a good thing with UART comms:
Did you check the actual baud rate on the wire?
2025-01-20 7:34 AM
Hi,
you cannot use an RC oscillator (HSI) and expect exact timing.
Use HSE + crystal , then you get correct frequency.
Or to check: put out the clock on MCO and check with a DSO - then you know,
is the hsi clock or your program the "problem".
2025-01-21 11:07 AM
Thank you very much for the answers, they were very useful. I checked the configuration. A new project was initialized from scratch to see what was affecting it. I reconfigured the clock but with HSI and within the RCC configuration the HSI calibration parameter at 64 worked correctly. It was 16 before, but now I have some doubts about this value with respect to what is selected, how does it affect the offset? and how does it work internally?
2025-01-21 11:17 AM
Why are you worrying about this "offset"?
For UART comms, it's just the frequency that matters.