This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE Time Synchonization

Hello,

I need do synchronize the time between two NRF52 devices. One is connected to the other by a custom BLE service. Do you have any ideas how this could be done?

Thanks, Tron

  • Like define format and send the signal?:) You can simply run RTC on both sides and then the one with supposedly more accurate time-keeping (= typically the one synchronized with some external "world" clock) will be sending packets to update/sync the other one. There are obviously limits in accuracy given by precision of the master + precision of delta between moment you will update the BLE stack and moment when the stack really issues the Tx packet + finally precision between capturing the packet by receiver and giving these data as event to higher "APP" layer which needs to decode them and reflect into its RTC based clock.

    In general you can achieve <5ms easily (if your source is "precise") if you test this path and compensate all the mentioned delays because they will be quite static in the end. It can be even done in by simple broadcaster/scanner architecture, you don't need active link for this. However there are obvious challenges common to any time-keeping digital system so real inaccuracy over time will be higher then millisecond range. Still for humans and world of cheap quartz watch it is fine. If you require some sub-millisecond time synchronization (not saying microsecond to something like this) then you are probably in wrong field. You can go with custom BLE stack (your own or open-source variants like Zephyr) which might give you better control over these delays in Tx/Rx stages but inaccuracy of LF clock source to nRF5x chips resulting in RTC inaccuracy and problem with periodic synchronization with some general "master" clock will be much bigger and practical problem... at least according to my experience. Btw. there are many similar questions and answers on this forum (there are even people trying to emulate ToF in SW on nRF5x), have you read these?

  • You can refer to this example at blog.

    devzone.nordicsemi.com/.../

    it is using the timeslot API + BLE for time synchronization.

Related