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.

CC1352R: Calibrate RTC

Part Number: CC1352R
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I have a desing with a cc1352R micro. I'm using the RT, and I have seen that it goes around 1 second faster per hour than it should. I have been searching and I saw that there is a register to be able to adjust the seconds.

This is the code I have put:

    HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINC0)=0x0000;  
    HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINC1)=0x0008; 
    ulong temporal=0;
    temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ; 
    if ((temporal & AUX_SYSIF_RTCSUBSECINCCTL_UPD_ACK)==0)
    {
        temporal|=AUX_SYSIF_RTCSUBSECINCCTL_UPD_REQ;
        HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL)=temporal ; 
    }
    temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ; 
    while ((temporal & AUX_SYSIF_RTCSUBSECINCCTL_UPD_ACK)==0)
    {
        temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ;
    }
    temporal&= ~AUX_SYSIF_RTCSUBSECINCCTL_UPD_REQ;
    HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL)=temporal ;

I have put a breakpoint when this code is finished, and I can see that the register AON_RTC:SUBSECINC has changed, so it seems that the code is ok. But after this is executed nothing else is working, I have a timer for some lightings, and they are not working fine.

If someone could explain what i am doing wrong with the code above...

Thanks!

Sandra

  • Hi,

    Could you provide more information regarding the version of Simplelink SDK you are using and some more details about your applications (OS, compiler, etc.)? That would be very useful to help you with your problem.

    Regards,

    Fausto 

  • Hi Fausto,

    I'm using code composer 10.4.0.

    The SDK I use is the 5.20.0.52

    The Sysconfig is 1.8.2.

    Thanks!

    Sandra

  • Hi Sandra,

    the procedure you are describing is very similar to the RCOSC calibration performed by the Power driver to compensate for RCOSC inaccuracies through the RTC. Could I ask why do you want to do this procedure? It should be automatically handled by the Power driver at every wakeup from standby. 

    Also, are you using the RF driver? The RF driver sets a dependency on the HF crystal, which is needed to precisely calibrate RCOSC. Not having such dependency set could lead to RTC inaccuracies in the order of magnitude you are observing.

    Regards,

    Fausto

  • Hi,

    I was trying to make it by miself because I saw it was not accurated.

    Yes, I am using RF driver. What should I do to manage this dependency on the crystal?

    Thanks!

    Sandra

  • Hi Sandra,

    If you are using the RF driver, the dependency on XOSC_HF (high frequency crystal oscillator) is set automatically. This is needed to have the precise timing required by the radio communication. By default the RCOSC and RTC are calibrated at every wakeup by the power driver (see sysconfig settings below)

    Also you say that you are using RTC, does that mean that you are using the RTC directly or that a driver creates a timer based on the RTC?

    Would it be possible for you to provide a simple application based on the empty example (you can find this in the simplelink SDK) in which your issue is reproducible so that we can debug it?

    Regards,

    Fausto

  • Hi,

    So if the HF oscillator is not well calibrated it can affect to the LF oscillator?

    Due lack of components, we have changed our HF oscillator from an external TCXO to a XOSC, and I have not checked it right...can it be related?

    I will try to have an example to provide you...

    thanks,

    Sandra

  • That's correct, The HF crystal is used to calibrate the HF and LF internal oscillators. Therefore having an HF crystal with poor accuracy would impact the calibration of the LF RC oscillator (in practice the values written inside RTC to compensate for LF oscillator inaccuracies).

    Regards,

    Fausto