2020-12-07 03:18 AM
Use 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.
Solved! Go to Solution.
2020-12-07 04:05 AM
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
2020-12-07 04:05 AM
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
2020-12-07 10:55 AM
Hi or you can calibrate LSI to 32768 or recalculate 180 to real 180s :beaming_face_with_smiling_eyes:
2020-12-08 02:47 AM
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
2020-12-08 08:30 AM
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