Synchronizing time with DA14585

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
ahiggs
Offline
Last seen:7 months 1 day ago
加入:2019-12-17 07:10
Synchronizing time with DA14585

Hello,

I have an application where a DA14585 is connected to an I2C ADC and sends measurement data via bluetooth to a receiver connected to a computer. I would like to synchronize the time on the computer with the sensor board. This way, I can send time stamped data from the sensor board and not have to worry about time skew during transmission or data processing. The receiver would simply subtract the synchronized time from the data's time stamp to calculate when the sensor measured the data.

I found the function lld_evt_time_get() that returns uptime in 625µs increments. Is there anything faster? My board is using both 16MHz +/-30ppm and 32.768kHz +/-10ppm crystals.

Thank you,

Ansel

Device:
PM_Dialog
Offline
Last seen:3 days 9 hours ago
工作人员
加入:2018-02-08 11:03
Hi ahiggs

Hi ahiggs

If I am not mistaken, you would like to implement a “Real Time Clock”, as the DA14585 doesn’t include an RTC. The lld_evt_time_get() measures the time based () on the 625us base time counter and returns the value of the BLE timer. You can use the function lld_evt_time_get() to get the current time in increments of 625us. If you need faster timing, you will have to disable sleep and use the systick timer which could provide as low as 1us accuracy. When ins sleep mode the 16MHz is shut down and the system is running with the Low Power Clock (either an External XTAL32 oscillator or internal RCX20 clock).

Thanks, PM_Dialog

ahiggs
Offline
Last seen:7 months 1 day ago
加入:2019-12-17 07:10
Thank you for your reply.

Thank you for your reply. Which crystal is the source for the lld_evt_time_get() function / BLE timer?

PM_Dialog
Offline
Last seen:3 days 9 hours ago
工作人员
加入:2018-02-08 11:03
Hi ahiggs

Hi ahiggs

The lld_evt_time_get() doesn't have a steady clock source but changes depending whether the device is sleeping or it is awake and measures the time passed from power up based on the XTAL16 and the XTAL32. To do so, the time that is measured is from the XTAL16 in active mode but during sleep mode it is measured through the XTAL32 and gets compensated and applied to the timer when the device is awake.

Thanks, PM_Dialog