How to calculate Time of Fly between two nrf52832 device

Hi support team,

I'm learning about distance calculation based on time of flight. I only have nrf52832DK here but i wanted to try. I'm looking for an example of getting the exact time when sending and receiving a message. I know that to measure very small time (0.033us/10m) need high precision directly working on the BLE registers and timer counter. Are there any similar examples? I found this example of sending advertise packet without softdevice, it's useful to mark the sending time.
Many thanks

  • The problem is that the radio peripheral operates at 16 MHz. So there's a 62.5 ┬Ás resolution in the clock, which translates to 20 m. Unless you have a times that's directly connected to the radio that can measure the time, it's very hard if not impossible to make a useful system