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 output frequency of a crystal can vary significantly due to drift in temperature. A hybrid software and hardware approach can be applied to achieve temperature compensation for the RTC. The RTC supports temperature compensation up to ±240 ppm.
Application software can make use of the on-chip temperature sensor to measure the device temperature at desired intervals (for example, every few seconds or minutes) to approximate the ambient temperature of the circuit. Then, software can be used to do parabolic calculations to determine the corresponding frequency error in ppm. This frequency error can then be written into the TCMP register for temperature compensation.
The RTCTCMPX field contains 8 bits which provide frequency correction up to ±240 ppm. The LSB represents ±1 ppm based on the RTCTCMPS bit in the TCMP register. When RTCTCMPS is set, each step in RTCTCMPX represents a +1ppm adjustment (up calibration). When the RTCTCMPS bit is cleared, each step in RTCTCMPX represents a -1ppm adjustment (down calibration).