Skip to main content
Khetag Goiaev
Associate II
July 9, 2021
Question

Trying to understand why USART is not working properly on high baud rates

  • July 9, 2021
  • 7 replies
  • 6237 views

While USART (receive from PC and transfer of gained information back, pic. 1) perfectly works on low baud rates like 9600, use of high baud rates leads to obscure results (bad receive and OK transmit, pic. 2)

STM32L476VGT6

This topic has been closed for replies.

7 replies

TDK
July 9, 2021

Higher rates are less tolerant to jitter or clock mismatch. Although 14400 shouldn't be a problem. Check to make sure the clock is accurate, pipe MCO out and measure frequency. If you're using HSI, ensure HSITRIM is set properly per the datasheet/reference manual.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Khetag Goiaev
Associate II
July 13, 2021

@TDK​ 

Not sure I can measure frequency (the only tool I have is logic analyzer).

Also tried to use different clock sources (including HSI) but no change.

Is there anything else that can cause the problem?

I start hating this board and myself for not being able to set up such a simple interface

TDK
July 13, 2021

This is exactly how a mismatch in clock rates would manifest. A logic analyzer will be enough to show the signal rate on the line. Double check that the speed, parity, and stop bits settings are identical on both the STM32 and the receiving PC.

It can be frustrating, but there is an explanation and solution if you want to spend the time to find it.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
July 13, 2021

> (the only tool I have is logic analyzer).

Then observe the USART pins using that tool.

What do you use as interface between STM32 and PC?

JW

Khetag Goiaev
Associate II
July 13, 2021

@Community member​ 

FT232R, if I'm not mistaken

waclawek.jan
Super User
July 13, 2021

OK and now show the waveforms on the STM32 UART pins observed by the logic analyzer.

JW

LMI2
Senior III
July 13, 2021

I wonder. If you have your clock frequencies high enough that you can divide good frequencies to the UART, then what else can go wrong. Is your ARM fast enough. Can your chip drive IO well. Can your system handle single bytes, but not several with zero delay between them.

waclawek.jan
Super User
July 14, 2021

Even your LA does not receive the data properly, why do you think this is problem in STM32?

Check your ground connections. Try using a different UART/USB transceiver.

JW

TDK
July 14, 2021

The STM32 TX looks perfect. The PC TX isn't a valid UART signal at any baud rate, but that's not the fault of the STM32.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Javier1
Principal
July 29, 2021

I see you got a nice logic analyzer, what if you use also an oscilloscope? ¿did you ruled out noise in the data lines already?

hit me up in https://www.linkedin.com/in/javiermuñoz/
S.Ma
Principal
October 5, 2021

I don't understand, 115200bps is typical baudrate for many applications, maybe because long ago the 2 wire I2C bus was 100kbps. I can make rs232 with HC05 module at 115200bps using HSI internal clock. No sweat bringup. It seems the issue is something like something obvious and overlooked.