cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411CEx RTC drift with LSI RC clock

Posted on April 05, 2017 at 16:20

Hi,

We are using STM32 internal RTC with 32.768 KHz LSI RC clock. We are observing very large drift in time(Approx 3min lag in 1 Hour).

We have gone through the RTC calibration application note.But that requires manual measurement of LSI clock deviation or external source to calculate LSI deviation.

Is there any other way to auto-calibrate RTC?

How much accuracy we can achieve with calibration?

Please suggest if any existing example code is there for STM32F4 RTC calibration.

#rtc-calibration #lsi-rtc #rtc #stm-32
1 REPLY 1
Posted on April 05, 2017 at 16:30

It is typically closer to 32 KHz, not 32.768 KHz, pick the right prescaler values

The LSI is NOT stable, it specified from 17 to 47 KHz, and it is highly dependent on voltage and temperature. I would not rely on it as an accurate clock source.

The F2 SPL has a good example of using TIM5 to calibrate the LSI, although I'd do the maths differently, this is portable to an F4

STM32F2xx_StdPeriph_Lib_V1.1.0\Project\STM32F2xx_StdPeriph_Examples\RTC\RTC_LSI\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..