2017-01-16 07:16 AM
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 #stm82017-01-16 08:52 AM
Would agree with your reading of the documentation, not sure where the 625000 comes from, presumably based on a 10 MHz clock?
2017-01-18 01:54 AM
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.