2015-04-08 06:56 AM
Hello,
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...2015-04-10 10:46 PM
Hello Mr. clive1,
I am now able to understand your second and fourth posts perfectly: I think now in terms of total generated ticky by the crystal which remains same in both. Generating a new PSC and PPM from the previous calibration stage is just a new interpretation (refactoring) of the same number of ticks to get the new set. Thank you again for your much appreciated contribution!