Skip to main content
gosal
Associate II
Jan 16, 2017 3:16 PM UTC
Question

Baud limited to 625000 in STM8S standard peripheral libraries

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
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Jan 16, 2017 4:52 PM UTC
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
gosal
gosalAuthor
Associate II
Jan 18, 2017 9:54 AM UTC
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.