cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB5MMG LSE clock 32.774 kHz?

EricNava
Associate II

Hello all,

I want to use the STM32WB5MMG module for a project which requires an RTC.
The datasheet states the module integrates a 32.774 kHz LSE crystal. That seems a bit strange to me because the standard clock for LSE is normally 32.768 kHz. Checking the reference manual RM0434 there does not seem to be any reference to using a 32.774 kHz clock.

I would like the RTC time to be as accurate as possible, is 32.774 kHz ok to use for the RTC? I guess I would need to somehow offset the faster clock to keep correct time.

Here are some calculations I did, which I have no idea if they are correct.
It seems that a 32.774 kHz clock divided by 2^15 = 1.000183105.

That equals 0.001000183 ms offset from the ideal 1 second per clock period.

Multiply by the number of seconds in a day, 0.001000183×86400 seconds = 86ms offset per day.

If you have any thoughts on the matter, let me know!
Thanks!

-Eric

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Welcome @EricNava, to the community!

please see the errata ES0525, section 2.1.1 for some more information about this rather unusual 32774Hz crystal.

To get a 1Hz output, you can correct it e.g. using smooth calibration, see RM0434, section 29.4.11.

Hope this helps?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

Welcome @EricNava, to the community!

please see the errata ES0525, section 2.1.1 for some more information about this rather unusual 32774Hz crystal.

To get a 1Hz output, you can correct it e.g. using smooth calibration, see RM0434, section 29.4.11.

Hope this helps?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Peter,

Thank you for pointing that out, I should have thought to look at the errata. I guess to use the RTC with the LSE, I will need to do a calibration with the module's 1Hz or 512Hz output.

Thanks for you help

 

 

I changed my previous comment while you are replying: you can correct the deviation of 183ppm via Smooth Calibration.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

How to for Smooth Calibration: see this thread.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

No worries Peter, thank you for linking the smooth calibration info!