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.

Is CC254X RTC not accurate?

CC254X RTC continues 12 hours, then it looses about 8 minutes.

Is its accuracy so poor? How can I improve the accuracy of CC254X RTC? Thanks!

  • Hi Hansome,

    The sleep timer / RTC uses the 32kHz clock as its time base. It seems you have 11000ppm (1.1%) wrong 32kHz frequency compared to a correct 32768Hz clock.
    Most likely this is due to the internal 32kHz RC oscillator being used instead of the 32.768kHz sleep crystal. See chapter 4.4.3 in the user guide (www.ti.com/.../swru191d.pdf) for more details.

    .:svend
  • It could also be due to incorrect load capacitors on the 32 kHz crystal.
  • Fredrik,

    I want to write a program to test the accuracy of the RTC, Any suggestion? Thanks!

    Hansome

  • You can try to use those APIs in OSAL_ClockBLE.c.
  • Fredrik,

    In rtc.h,
    typedef UTCTimeStruct rtc_datetime_t;
    void rtc_get(rtc_datetime_t* datetime);
    void rtc_set(rtc_datetime_t* datetime);

    In rtc.c,
    void rtc_get(rtc_datetime_t* datetime)
    {
    osal_ConvertUTCTime(datetime, osal_getClock());
    }

    void rtc_set(rtc_datetime_t* datetime)
    {
    osal_setClock(osal_ConvertUTCSecs(datetime));
    }

    When simpleProfile_ReadAttrCB,
    case SIMPLEPROFILE_CHAR6_UUID:
    *pLen = SIMPLEPROFILE_CHAR6_LEN;
    rtc_get((rtc_datetime_t*)pValue);
    //VOID osal_memcpy( pValue, pAttr->pValue, SIMPLEPROFILE_CHAR6_LEN );
    break;

    When simpleProfileChangeCB,
    case SIMPLEPROFILE_CHAR6:
    SimpleProfile_GetParameter(SIMPLEPROFILE_CHAR6, &datetime);
    rtc_set(&datetime);
    break;

    This is my codes about RTC, but the accuracy is bad. Is this usage of RTC correct? Thanks!

    Hansome