Skip to main content
Explorer
May 14, 2025
Question

RTC calib register values

  • May 14, 2025
  • 1 reply
  • 287 views

I am trying to calibrate 512Hz RTC  to 1ppm or <1ppm. 

Desired Frequency = 512Hz

Average Frequency Obtained is = 512.0073Hz

What should be the value of CALP and CALM ???

 

(I used the CALP = 0 and CALM = 15, but still the ppm that I obtained is ~14)

 

Could you please help me with what should be take care of too obtain a value closer to 1ppm. 

I used both oscilloscope and 53131a universal counter to measure the RTC calib frequency out. 

 

 

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    May 15, 2025

    Hello @J_Thomas;

     

    Are you asking about the formula to calculate the effective calibrated frequency?

    According to reference manual RM0440 

    FCAL = FRTCCLK x [1 + (CALP x 512 - CALM) / (220 + CALM - CALP x 512)].

    CALW16 bit of the RTC_CALR register can be set to 1 to force a 16- second calibration cycle period.
    In this case, the RTC precision can be measured during 16 seconds with a maximum error of 0.954 ppm.

    For more information, I recommend you How to calibrate the STM32's real-time clock (RTC) article. This article provides a step-by-step guide on how to calibrate the precision of a real-time clock (RTC). 

     

    Thank you.

    Kaouthar