cancel
Showing results for 
Search instead for 
Did you mean: 

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

Martin.Sergio
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
berendi
Principal

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.

View solution in original post

2 REPLIES 2
berendi
Principal

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

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.