Skip to main content
Martin.Sergio
Associate III
January 13, 2020
Solved

STM32L451 with UART at 1200 7N2 with different clock tree configurations

  • January 13, 2020
  • 2 replies
  • 922 views

Hello,

I have an app working fine with a device that works at 1200bps 7N2 using a Clock Tree with HSE CLK configuration at 8MHz.

If I change the Clock Tree to work with PLL to other frecuencys like 16,32,64,72 every work fine, even if I config at rare frequencies like 76 or 78MHz works fine but if I configure to work at 80MHz the UART does not receive any data (at 79MHz does not work neither)

My UART Driver works with DMA to transfer RX data to my buffer and IDLE_LINE to finnish the reception.

Where can the error be?

Best Regards,

Sergio

This topic has been closed for replies.
Best answer by berendi

78000000 / 1200 = 65000

80000000 / 1200 = 66666

If the baud rate divisor has 16 bits (goes up to 65535), it can't handle the second case.

2 replies

berendi
berendiBest answer
Principal
January 13, 2020

78000000 / 1200 = 65000

80000000 / 1200 = 66666

If the baud rate divisor has 16 bits (goes up to 65535), it can't handle the second case.

berendi
Principal
January 13, 2020

UARTs can be clocked directly from HSI, so the rest of the system can run on 80MHz, while the UART clock is lower. For extremely low baudrates you can use LSE if it's present.