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.

CC2640R2F: Send timestamp with data

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Dear Admin

We are collecting 3-axis acceleration data from an accelerometer. Each dataset is 6 bytes long. We now want to attach a real time timestamp with this dataset. Since our sampling time is in milliseconds, we would need the timestamp to have millisecond resolution. What are the steps we should follow in order to implement this?



  • Hey Tushar,

    I see this was posted to the Bluetooth forum. To confirm, are you asking how to send accelerometer data over Bluetooth LE? If you are not using Bluetooth LE to send the data, what communication protocol are you using?

    I don't  see any limitation on appending the timestamp data to the accelerometer data, but maybe I'm misunderstanding the question. You can add the timestamp, but it will generally not be in sync with a real time clock unless that is done in software. Essentially you will have to have an external source that is sync'd to a real timed clock, otherwise the timestamp would very likely be an internal timestamp of the device.

    If you can let me know what communication protocol, example project in the SDK and version, I might be able to provide more information.

  • Hey Ammar

    Yes, I am using BLE to send data from CC2640R2 to a phone. I started off of the Simple Peripheral example and we were using the SDK. 
    The intention is to have the device generated timestamp in sync with the real time clock of the phone for example.



  • I would recommend, in this case, looking at implementing the Bluetooth SIG defined Time Profile: on the device.

    You can discover the service from the cell phone and extract the time data. Unfortunately, I'm not aware of an up to date example of this on the CC2640R2F.I hope this helps.

  • Thanks Ammar. I will have a look at how to implement that profile.

    In the CC2640 peripheral device itself, what is a way to generally timestamp (NOT realtime) the data before sending over bluetooth? Is there an example or otherwise can you point to the right functions that we can use?



  • I would use the internal radio timer for timestamps, since it already exists and you shouldn't need to start your own from the application layer. You can call RF_getCurrentTime() and use that variable to timestamp.

  • Hi,

    I have a project similar to what you are doing. I used the utc_clock.c located at C:\ti\simplelink_cc2640r2_sdk_4_40_00_10\source\ti\blestack\common\cc26xx\time

    You need to update the utc clock value from smart phone if there is a power on reset or system reset.