cancel
Showing results for 
Search instead for 
Did you mean: 

Baud limited to 625000 in STM8S standard peripheral libraries

gosal
Associate III
Posted on January 16, 2017 at 16:16

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

assert_param(IS_UART1_BAUDRATE_OK(BaudRate));

Digging into stm8_uart1.h, the default baud setting for macro

IS_UART1_BAUDRATE_OK 

is 625000 but UART1 is capable of up to 1Mbaud based on the datasheet (right?) I need to run it at 750kbaud and commenting that assertion out I got it working at 750kbaud without issues.

So my question is: is there a reason why that default value is 625000 ? 

#uart1 #stm8
2 REPLIES 2
Posted on January 16, 2017 at 17:52

Would agree with your reading of the documentation, not sure where the 625000 comes from, presumably based on a 10 MHz clock?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 18, 2017 at 09:54

Thanks

Turvey.Clive.002

‌ , yeah I think the 10MHz clock case would justify the default 625000 limit but I would have expected this to be based on a check toCLK_GetClockFreq() not a hardcoded limit.