cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L051C8T6, standby mode using RTC to wake up,RTC clock choose the 37k LSI ,wakeup time problem

*于.1
Associate II

0693W000006EpKJQA0.png0693W000006EpLRQA0.png0693W000006EpMtQAK.pngUse STM32L051C8T6 for low-power design. In standby mode, RTC is used to wake up. The RTC clock is internal 37K clock. After 1Hz frequency division, the program sets 180s to wake up. As a result, it wakes up at 160s. Please ask if there is a problem with the configuration.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Despite the fact STM32CubeMX gives 37kHz for the LSI, the real frequency is in the range of 26...56kHz, typically 38kHz, i.e. -31...+47%. Please check the datasheet of the STM32L051, section 6.3.7, currently page 71: LSI oscillator characteristics.

This clock source is based on an RC oscillator and is completely independent of the other clock sources to provide additional security when used in conjunction with the IWDG (Independent Watchdog).

Please use one of the other clock sources if you need an accurate clock, e.g. the LSE with an external crystal of 32.768kHz.

When your question is answered, please close this topic by choosing Select as Best.

/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

4 REPLIES 4
Peter BENSCH
ST Employee

Despite the fact STM32CubeMX gives 37kHz for the LSI, the real frequency is in the range of 26...56kHz, typically 38kHz, i.e. -31...+47%. Please check the datasheet of the STM32L051, section 6.3.7, currently page 71: LSI oscillator characteristics.

This clock source is based on an RC oscillator and is completely independent of the other clock sources to provide additional security when used in conjunction with the IWDG (Independent Watchdog).

Please use one of the other clock sources if you need an accurate clock, e.g. the LSE with an external crystal of 32.768kHz.

When your question is answered, please close this topic by choosing Select as Best.

/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 or you can calibrate LSI to 32768 or recalculate 180 to real 180s 😁

Calibrating/recalculating would only be a temporary action as LSI does not provide long-term stability and is therefore not recommended.

An alternative clock source could be the MSI (65.5 kHz...4.2 MHz, depending on the selected frequency range) or the HSI (16 MHz). Their accuracy is comparable to any free-running oscillator, but better than LSI and possibly applicable for UART communication.

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.

Maybe i mean calibrate before every use based on HSI or HSE ... measure some LSI clocks and then calculate actual converted 180s.

I mean you have here acuracy equal to HSI ... or plus minus 2s