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.

CC26xx: using RTC under TIRTOS

Other Parts Discussed in Thread: CC2640

Hi,

I tried to read from CC2640's RTC in the same way as it done in rtc driver and other functions that I found:

key = Hwi_disable();
curSeconds = HWREG(AON_RTC_BASE + AON_RTC_O_SEC);
curSubseconds = HWREG(AON_RTC_BASE + AON_RTC_O_SUBSEC);
Hwi_restore(key);

It works, but curSeconds value is 0 after each reboot.

I want to implement a 4-byted UNIX-time watch in CC26xx TIRTOS-based app (e.g. SimpleBLEPeripheral). Don't need to use any TimeApp GATT services. Just need to place 4-byted UNIX time to hardware RTC and get it back in a hour or day. Reading topics such as e2e.ti.com/support/wireless_connectivity/f/538/p/413259/1470336  leadis me to conclusion that it's impossible to use CC26xx's RTC as RTC itself in TIRTOS.

In previous practice I widely used embedded RTCs (or external RTCs such as DSxxx) for UNIX-time or real time counting and don't understand why I cannot use it in MC that contains RTC and 32KHz crystal.

How should this task (reboot-independent UNIX-time watch) be solved in CC26xx application with TIRTOS?

  • Hi Slava,

    The RTC should not be accessed directly in TI RTOS unless you know what you're doing since the value is latched between reads of seconds and subsecond. The Clock_getTicks() API should be used to access the RTC indirectly instead.

    We do unfortunately not have an RTC whose value are retained during a reset so it will read 0 every time you reset.

    Regards,
    Svend