cancel
Showing results for 
Search instead for 
Did you mean: 

STM8AF UART Baudrate limitation in stdlib.

NKorn.3
Associate

I've noticed that in the STM8 standard peripheral libraries, in the UART3_Init function there is an assertion checking the baud setting:

assert_param(IS_UART3_BAUDRATE_OK(BaudRate)), which limits the baudrate to 625000.

BUT according to the datasheet the max possible baudrate is 1/16 of f_masterclk.

So my question is: is there a reason why that it is limited to 625000 hardcoded ? 

1 REPLY 1
Willunen
Associate III

To get the baudrate of 625000 you say you need a MCLK of 16 x 625000 = 10 MHz. As far as I see STM8AF will go up to 24 MHz, so that means you have about 2 x 8 = 16 MCLK cycles to get a byte into the uart.