cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 LPUART LSE Error

MLam
Associate III

Hello everyone,

I'm working on a project with a STM32L072CBT6.

I'm using LPUART (PB10 / PB11) at 9600 bauds to communicate with an other board. For low power consumption, i'm using LSE for my LPUART.

When i check my bauds rate on my oscilloscope, i get the value of 93.3 that represent ~10718 bauds.

I have try to modifiy load capacitor of my resonnator (12pF and 6pF) but no change.

Do you have advice about this error in baud rate ?

 Resonnator configuration  (ABS07-32.768KHZ-6-4-T):

MLam_0-1694707277000.png

My clock configuration in STM32CubeMX:

MLam_1-1694707448466.png

My LPUART configuration :

MLam_2-1694707527865.png

My RCC configuration:

MLam_3-1694707578320.png

Best regards,

MLam

1 ACCEPTED SOLUTION

Accepted Solutions

If you measure individual bits, you can only measure integer periods of the 32768Hz LSE clock, i.e. the calculated "baudrate" from individual bits can be for 9600 setting only 32768/3=10922 or 32768/4=8192. LPUART achieves a relatively good 9600 Bauds by dithering, i.e. alternating appropriately between these two bit lengths.

JW

View solution in original post

7 REPLIES 7
AScha.3
Chief II

1. check LSE frequ. -> activate MCO and set to LSE ; check mco output ...

2. maybe try crystal drive high , not low.

AScha3_0-1694708819188.png

3. try lower baud, for test 1200 or so.

If you feel a post has answered your question, please click "Accept as Solution".

If you measure individual bits, you can only measure integer periods of the 32768Hz LSE clock, i.e. the calculated "baudrate" from individual bits can be for 9600 setting only 32768/3=10922 or 32768/4=8192. LPUART achieves a relatively good 9600 Bauds by dithering, i.e. alternating appropriately between these two bit lengths.

JW

Hello AScha.3,

This my return after your reply:

1) Frequency is correct, Picture below get from MCO output

 

SCR38.png

2) I have try in High LSE drive capability but nothing change.

3) Resultat for various bauds :

9600 bauds configured10718 bauds mesured
4800 bauds configured5480 bauds mesured
1200 bauds configured1210 bauds mesured

btw set drive -> high , just if crystal not starting or shows problems (depends on specs of crystal, flux remains on board etc.)

+

did you read, what Jan wrote? 

If you feel a post has answered your question, please click "Accept as Solution".

OK but when i get frequency on my MCO GPIO that seems that my crystal start correctly no ?

Yes i have read what Jan wrote, i'm currently trying to modify UCESM bit.

yes, seem working fine.

If you feel a post has answered your question, please click "Accept as Solution".
MLam
Associate III

To conclude,

I have reduce my baud rate to 1200 to get a better match.

In a same time i see that my DMA+LPUART often crash when i try to get my data at initialization.

So i have added a delay for my LPUART Interrupt when i power on my system.