2021-01-25 07:17 PM
2021-01-26 05:23 AM
The LPUART can be clocked from various sources, but you have to compromise on accuracy when choosing the LSE as the clock.
The closest standard baudrates with an error below 2.5% are:
[edit]See comments below[/edit]
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Good luck!
/Peter
2021-01-26 06:40 AM
So, is this a lie?
JW
2021-01-26 08:03 AM
Oops - @Community member is right. The values in RM0377 are correct because the 32 kHz is multiplied by 256 and then divided by the value in BRR.
The question now is what value @Wjian.4 uses for BRR when trying to reach 9600 bps and where did he get it from?
Regards
/Peter
2021-01-26 08:32 AM
Hi @Peter BENSCH ,
And did you try?
I don't think there's any multiplier (i.e. PLL) involved. IMO it *is* a lie, and attempting to Tx at 9600 will result in transmitting bits with duration alternating between 3 and 4 1/32768 periods so, that in the long term the bits duration averages to the required 3.4 periods. The Rx would sample similarly.
This has chance to work with a precise counterpart and no other sources of timing error (asymmetric skew e.g. using optocouplers or slew rate limiting transceivers with asymmetric receiver threshold, and similar); however, I see lots of chances to result in marginal or simply not working combinations, e.g. if you'd try to communicate using this scheme on both ends.
That assertion in RM wouldn't be a lie, would there be a clean description of the LPUART working and all the gotchas I've mentioned above. Plus an exhaustive set of related appnotes, and, of course, comprehensive set of clean code examples without the "libraries" gobbledygook.
I did not try either, though; but would be surprised to be wrong.
JW
2021-01-26 05:44 PM
I tried.The value of BBR is set to 0x0036a.When the baud rate is set to 4800,The value of BBR is set to 0x006d4. And actual BaudRate is 4672,The error is less than 3%. 32768 divided by 7 is 4681.So,the error of 4800 is small.As shown in the figure below,this is the actual baud rate when set to 9600.The pulse width of each bit is 8.3kHz or 11kHz.
Although the value of BBR is set to 0x0036a,but the fractional part of BBR(6a) no longer works.The total reason is that 32.768kHz can't divide the frequency to the corresponding period.
2021-01-26 05:58 PM
So,is my idea right? The LPUART can not use LSE to configure BaudRate 9600?The error values in RM0377 are Wrong?Can you provide the actual error value when configure BaudRate 9600?
Regards