SLAU846B June 2023 – November 2024 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3519
The RTC module can be calibrated for crystal manufacturing tolerance or offset error for higher timekeeping accuracy. A crystal frequency error of up to ±240 ppm can be calibrated smoothly over a period of 60 seconds.
The CAL register is used to adjust the frequency. The calibration value is written into the RTCOCALX field in the CAL register, and each LSB in this field represents approximately ±1 ppm correction (the sign is based on the RTCOCALS bit in the CAL register). When RTCOCALS is set, up calibration is selected and each LSB in RTCOCALX represents +1 ppm adjustment. When RTOCALS is cleared, down calibration is selected and each LSB in RTCOCALX represents -1 ppm adjustment. The RTCOCALX field is 8 bits. Software can write a value of up to 256ppm into this register, but the maximum frequency error that can be corrected is only 240ppm. Software is responsible for writing legal values into RTCOCALX. Offset error calibration is inactive when the RTC is not enabled (MODCLKEN is cleared) or when RTCOCALX is zero. Writing to the RTOCAL register resets the temperature compensation to zero.
To calibrate the RTC frequency, the RTC_OUT output signal is available on a pin. The RTCCALFX field in the CAL register can be used to select the frequency rate of the output signal to the pin. When RTCCALFX = 0x0, no signal is output on the RTC_OUT pin. The other settings of the RTCCALFX select one of the three frequency options to output: 512Hz, 256Hz, or 1Hz. RTC_OUT output can be measured, and the result of this measurement can be applied to the RTCOCALS and RTCOCALX bits to effectively reduce the initial offset of the RTCCLK.