AnsweredAssumed Answered

Periodic RTC calibration STM32F1xx

Question asked by on Apr 8, 2015
Latest reply on Apr 11, 2015 by

MyProject: Calibrate RTC LSE clock continuously based on an external time reference.
MyProblem: Calculation of re-calibration value.
Description: I start a calibration measurement interval time t1 and stop it at t2. These two are reference times. I also note the corresponding RTC times t1_rtc and t2_rtc.
Based on these values I calculate the time difference in PPM and and adjust my RTC prescaler and calibration value, e.g., call them "PS_OLD" and "CAL_OLD". This works fine since I have no calibration value in RTCCR register.

Like this, I want to do periodic measurements and repeat the calibration, for example every 10 days or weekly.

Problem: I do not know how to calculate the new calibration value, if I have already a calibration value in RTCCR register; e.g., calculation of new prescaler and calibration value PS_NEW and CAL_NEW?

hope I was able to illustrate the problem and thanks for any contribution...