SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
To compensate for any inaccuracy of the 32-kHz oscillator the MPU can perform a calibration of the oscillator frequency, calculate the drift compensation versus a 1-hour period, and load the compensation registers with the drift compensation value. Auto compensation is enabled by the AUTO_COMP bit in the RTC_CTRL_REG register. If the value of the COMP_REG registers (RTC_COMP_LSB_REG and RTC_COMP_MSB_REG) is positive, compensation occurs after the second change event. COMP_REG cycles are removed from the next second. If the COMP_REG value is negative, compensation occurs before the second change event. COMP_REG cycles are added to the current second. This enables compensation with a 1 32-kHz period accuracy each hour. The waveform in Figure 25-7 summarizes positive and negative compensation effect.
Access to the RTC_COMP_MSB_REG and RTC_COMP_LSB_REG registers must respect the available access period. These registers should not be updated during compensation (the first second of each hour), but it is alright to update them during the second preceding a compensation event. For example, the MPU could load the compensation value into these registers after each hour event, during an available access period.