Skip to main content
NKorn.3
Visitor II
November 7, 2019
Question

STM8AF UART Baudrate limitation in stdlib.

  • November 7, 2019
  • 1 reply
  • 1283 views

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 ? 

    This topic has been closed for replies.

    1 reply

    Willunen
    Associate III
    November 13, 2019

    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.