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:
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
Thank you for your reply. Which crystal is the source for the lld_evt_time_get() function / BLE timer?
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