2017-04-05 07:20 AM
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-322017-04-05 07:30 AM
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