SLAU847D October 2022 – May 2024 MSPM0L1105 , MSPM0L1106 , MSPM0L1227 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2227 , MSPM0L2228 , MSPM0L2228-Q1
In the RTC, offset error calibration takes place over a period of 60 seconds. To achieve approximately ±1ppm correction, the 16kHz clock (Q0 output of RT0PS) is adjusted to add or subtract 1 clock pulse. This correction happens once every quarter second until the programmed ppm error is compensated.
All three possible output frequencies 512Hz, 256Hz, and 1Hz at the RTC_OUT pin are affected by calibration settings. RT0PS interrupt triggered by RT0PS – Q2 to Q7 is based on calibrated clock. RT1PS interrupt (RT1PS) and RTC clock time event interrupt (RTCTEV) are also based on the calibrated clock.
The following can be used as a guide for setting RTCOCALS and RTCOCALX, given fRTCCLK = fRTCCLK, meas x divider factor (set by RTCCALFX):
Slow Crystal (fRTCCLK < 32768Hz )
Fast Crystal (fACLK ≥ 32768Hz)
As an example for down calibration, when the measured frequency is 512.0241Hz against the reference frequency of 512Hz, the frequency error is approximately 47ppm high. In order to decrease the frequency by 47ppm, RTCOCALS should be cleared, and RTCOCALx should be set to Round (60 x 16384 x (1-512.0241x64/32768)) = 46.