This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Calibration Mechanism in RTC_C

Other Parts Discussed in Thread: MSP430FR6972, TIDM-TEMPCOMPENSATED-RTC

Hello,

I have a question about calibration mechanism in RTC_C module.

Our mcu is MSP430FR6972 and we would like to implement rtc calibration for crystal offset error.

On user guide there is a sentence like that: "In RTC_C, the offset error calibration takes place over a period of 60 seconds."

In order to achieve calibration; do we need to call calibration function in every 60 seconds? Or if we set the calibration registers, will mcu calibrate rtc automatically?

Thanks.

  • Hello Olcay,

    Besides the description provided in Section 23.2.7 of the User's Guide, Figure 23-2 shows that the RTCOCAL calibration logic and writes are performed by the hardware and therefore no further calibration operations are necessary from the software aside from initializing the registers.

    Regards,
    Ryan
  • Hello Ryan,

    Thanks for your reply.

    I would like to consult another issue. Below information is provided on User's Guide:

    'Real-time clock offset error calibration is inactive when RTC_C is not enabled (RTCHOLD = 0) or when

    RTCOCALx bits are zero. RTCOCAL should only be written when RTCHOLD = 1.'

    That's totally clear but if you analyze the e-meter software (www.ti.com/.../TIDM-TEMPCOMPENSATED-RTC) you will see that RTCOCAL register is written when RTCHOLD = 0;

    ...

    RTCCTL1 &= ~(RTCHOLD); // Start RTC calendar mode

     if(crystal_base_error < 0)

       RTCOCAL = 0x8000 - crystal_base_error; // up -

     else

       RTCOCAL = crystal_base_error; // Down +

    RTCCTL0_H = 0;

    ...

    I am a bit confused, which one is appropriate way to write RTCOCAL registers?

    Thanks.

  • Hello Olcay,

    The User's Guide contains the appropriate format for controlling the RTC, thank you for bringing up this inconsistency with the TIDM-TEMPCOMPENSATED-RTC as the source code should most likely be amended. You can easily fix this issue by putting RTCCTL1 &= ~(RTCHOLD); after the if-else statement.

    Regards,
    Ryan

**Attention** This is a public forum