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.

CC2640/CC2650 RTC timestamp

Expert 1340 points
Other Parts Discussed in Thread: CC2640, SYSBIOS

I am using the CC2640 with RTOS/BLE with the SimpleBLEPeripheral as the basis of my firmware. I read data from various sensors and would like to periodically attach a real-time (clock time) timestamp with the data. I am unsure of what "aon_rtc.h" vs <ti/sysbios/family/arm/cc26xx/TimestampProvider.h> is and which one to use with RTOS. To put it simply, I would like this peripheral to connect with a central, set the peripheral's clock to the current time via a write from the central, then send notifications back to the cental with data+timestamps. How can I do this? Thanks!

  • Hi Tosa,

    One example implementation you can reference is the TimeApp. This uses the Clock module to maintain the timebase.

    Note that synchronization of the time from the Central will have some error based on the connection interval. The error magnitude will increase as the connection interval increases.

    Best wishes
  • Hi JXS,

    The UTC_clock.c file looks good, but it seems that the time (UTC_timeSeconds) needs to be set every time the peripheral is powered up. If my system powers down this value will be lost, correct? How can I implement this so that this value can be reset upon power up (assuming that some RTC component of the CC2640 does not power down). Or do I simply need to synchronize the time with the central upon power up each and every time there's a BLE connection made? Thanks!
  • Hi Tosa,

    The RTC is not powered when the CC2640 is in shutdown mode. You will need to resync with the Central - or - use an external RTC that is always powered.

    Best wishes