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

Latency measurement/log

Hi, all. I would like some serious help. I have three nRF52840 boards and have been running all the examples from the blinky to light switch/dimming. I am, however, stuck as to how i can send (arbitrary/advert) packets between these and get a log of the latency. I want the one board to send a packet to the another board. The receiver must acknowledge that it has received by sending its own packet back. I need to know the time it takes for this exchange to occur. I will be connecting the boards as a mesh. Thanks.

Parents
  • The radio events are clearly spelled out in the nRF specification.  events_address occurs immediately after reception an address. Although the event clock would be p_clock (16MHz), since the radio phy is either 1 or 2 MHz you should consider the resolution of this event to be about +/-0.5usec since the phy symbols are up to 1usec long and with the Gaussian filtering they don't have a hard edge like digital signals.

    However, that event won't do you a lot of good since you can't interrupt into your code while the softdevice is working.  At best you could route the event to gpiote and do something with it there.

    Likely a better way to handle your question is with a mix of BLE and custom protocol.  By timeslotting some custom protocol comms in with the BLE work you can use the radio to synchronize itself in a system and thereby discover your latency.  The same rules apply that basic error will be about +/-0.5usec but at least it is feasible.

    Nordic published a really nice time sync solution.  You can read about it here: devzone.nordicsemi.com/.../wireless-timer-synchronization-among-nrf5-devices

Reply
  • The radio events are clearly spelled out in the nRF specification.  events_address occurs immediately after reception an address. Although the event clock would be p_clock (16MHz), since the radio phy is either 1 or 2 MHz you should consider the resolution of this event to be about +/-0.5usec since the phy symbols are up to 1usec long and with the Gaussian filtering they don't have a hard edge like digital signals.

    However, that event won't do you a lot of good since you can't interrupt into your code while the softdevice is working.  At best you could route the event to gpiote and do something with it there.

    Likely a better way to handle your question is with a mix of BLE and custom protocol.  By timeslotting some custom protocol comms in with the BLE work you can use the radio to synchronize itself in a system and thereby discover your latency.  The same rules apply that basic error will be about +/-0.5usec but at least it is feasible.

    Nordic published a really nice time sync solution.  You can read about it here: devzone.nordicsemi.com/.../wireless-timer-synchronization-among-nrf5-devices

Children
No Data
Related