SLAU846A June 2023 – October 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1
When the temperature compensation value is written into RTCTCMPX, it is added together with the offset error calibration value an the resulting value is taken into account from the next calibration cycle onwards. The ongoing calibration cycle will not be affected by writes into the TCMP register.
Reading the TCMPX at any time returns the cumulative correction value (offset + temperature) which is the signed addition of RTCOCALX and RTCTCMPX, and the updated sign bit (RTCTCMPS) of the addition result. Note that writing to the RTCOCAL register will reset the temperature compensation value to zero.
For example, when RTCOCALX is +150 ppm, and RTCTCMP is written with +200 ppm, the effective value taken in for the next calibration cycle is +240 ppm (saturated). If the RTCOCALX is +150 ppm, and RTCTCMP is written with +50 ppm, the effective value taken for the next calibration cycle is +200 ppm (40 ppm of compensation headroom remains).
To achieve effective temperature compensation, software is responsible to:
Writing to the TCMP register for temperature compensation requires 60 seconds (one minute) to take effect as a part of the next calibration cycle. Therefore, if temperature must be measured more frequently than once per minute (for example, once every 5 seconds) then it needs to average the error over one minute and update the TCMP register once per minute.