Hi,
I'm trying to implement timer synchronization on one central and multiple peripherals, I'm using nRF52840 and NCS v2.8.0. I've seen the example conn_time_sync which uses anchor point events for synchronization, but I need to sync 16MHz timers, and also measure the drift between the timers on each device caused by crystal inaccuracy, so sdc_hci_cmd_vs_conn_anchor_point_update_event_report_enable api doesn't help me because it only gives the timestamp of the system timer running on RTC.
Instead I've tried to use sdc_hci_cmd_vs_set_conn_event_trigger to achieve a similar result by capturing timer value on connection events using PPI, but after some testing I realized it's not triggering the events at the same time on central and peripheral. I used the connection event trigger to toggle GPIO and measured the timings with logic analyzer, seems like the peripheral event is triggered ~40us before the central event. This time is not consistent either, it varies between 41-45us:
Description of the api says: "When enabled, this feature will trigger a (D)PPI task at the start of radio events.", but it's unclear to me which events exactly.
1. Are these connection events triggered by a radio event (EVENTS_READY, EVENTS_ADDRESS, etc.), and which one exactly?
2. Why would the peripheral event be triggered before the central event?
3. How is the achor point timestamp capture implemented in sdc_hci_cmd_vs_conn_anchor_point_update_event_report_enable, is it possible to manually implement something similar to trigger event on both central and peripheral at the same time, and capture the 16MHz timer on each device?