cancel
Showing results for 
Search instead for 
Did you mean: 

RTC temperature compensation clarification

Anand Kumar
Associate III

Hi Team,

I need some help to understand what I am doing is correct or wrong. A required guide from ST's expert

Basically working on RTC temperature Drift compensation, so I have referred the RTC temperature compensation APP document from ST's

The link provides: https://www.st.com/resource/en/application_note/an2604-stm32f101xx-and-stm32f103xx-rtc-calibration-stmicroelectronics.pdf

I am using STM8AL3189 MCU,

For RTC calibration, we have CALP = 1 *512Clock Pulse

CALM = [8:0] ==> 0 to 0x1FF

using combination of CALP and CALM we can achieve up to 511 to 512 Clock pulses

Question 1 :

Steps followed to calibrate the RTC temperature compensation

  1. RTC clock is 32768Hz, K = -0.04ppm/*c^2, To = 25*c, T = calculating from the internal junction temperature
  2. acc = 20 +  k *(T – To)^2; 
  3. After calculating the acc, I have come up with this formula provided from ST's to Convert this PPM to clock
  4. 0693W00000JPQHxQAP.png

Here, I have attached the excel sheet to calculate both the negative and positive PPM value

question 2: I have enabled calibration out for RTC 512Hz, and if I probe that to logic analyzer

I am seeing 0693W00000JPQKNQA5.png512.035

512.033

512.031

512.035

512.033

Average = 512.0334

(512/512.0334) - 1 *1000000 ==> -65.23ppm (but is this correct) since i referred from APP notes

Question 3:

How frequently need to update the CALP and CALM values to compensate for the drift and how to validate and when need to measure after the calibration using a 32second window (-487.1 to 488.5 ppm) with a resolution of 0.954ppm?

can you please guide the process is which following is correct or wrong for all the questions?

Thanks in advance.

Regards,

Anand Kumar N S

0 REPLIES 0