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

time synchronization across different nodes in a mesh network, single hop as well as multi hop.

I am working on time synchronizations between different nodes in a mesh network. I have earlier worked on the radio and the ppi examples given. I wish to generate time stamps at each send and receive events between two different nodes for which i am using the nRF radio along with two crystal oscillators, 16 M XOSC as well as 32.768 KHz XOSC with quartz crystal. Could you let me know that if i am using the ppi with the radio functionality, how do i define the two nodes in my code between which i want to send packets. then can i extend this case for n nodes too.

Parents
  • Yes I can see start_reciever() but I don't see when it's called.

    Yes, using wireshark and analyser is for verification. The question is how you are planing to do the actual time synchronization ? Do you have an idea of what you are trying to achieve ?

    Basically please explain what you meant here: I wish to generate time stamps at each send and receive events between two different nodes for which i am using the nRF radio

    The main point of time synchronization is to calibrate multiple devices to start a timer at the same time. By having the synchronized timer we can add a time stamp on every data we sample or execute a command at the same time.

    What we do in the example I pointed you to (which only takes 15 minutes to read and 5 minutes to test ) is to do TASKS_CAPTURE on the timer of the master, add the latency (consistent time delta by using another timer), then put that value in the radio packet.

    On the receiver/slave side, when receiving the packet, it uses that timer captured value to update its own timer with that value (includes the delta). After that the timers on both device should be synchronized.

    Note that this solution is only for a start network, where one single node can update multiple nodes around it. I don't know how do you plan to do it for a mesh network. That why I keep asking how do you plan to do your mesh.

    And yes, we don't have a solution to avoid CPU involve here. We need the CPU to put the captured timer value to radio packet. But we can have a consistent time for doing that by using another timer and PPI to start radio transmission a fixed time after the capture task.

  • Thanks for providing the document. My understanding is that you need to capture time stamp on both side and your approach require time-stamp packet from both direction to do calculation and estimate a12, b12 from that.

    Our approach is a little bit different that we only use packet from one direction and try to reset the timer on node 2 to set the offset b12 to zero using the time stamp. We reduce the affect of the drift a12 by keep sending time stamp packet so that the drift create by the timer won't exceed the real time requirement.

    You can re-use what we implemented in our example on the transmission side. Use PPI to trigger a TASK_CAPTURE of the free run timer from COMPARE event of another timer (TIMER2) (You can ignore this, and trigger TASK_CAPTURE your way) Then use CPU to put the Captured value of the freerun timer to radio packet. Then TIMER2 will trigger the transmission of the radio after that using PPI. (This is important and shouldn't be ignored) The involvement of the CPU here is only to put the timestamp into radio packet. It wouldn't cause any un-predictable latency because we will use the TIMER2 and PPI to trigger radio. Most of the task is done using PPI and the latency is consistent.

Reply
  • Thanks for providing the document. My understanding is that you need to capture time stamp on both side and your approach require time-stamp packet from both direction to do calculation and estimate a12, b12 from that.

    Our approach is a little bit different that we only use packet from one direction and try to reset the timer on node 2 to set the offset b12 to zero using the time stamp. We reduce the affect of the drift a12 by keep sending time stamp packet so that the drift create by the timer won't exceed the real time requirement.

    You can re-use what we implemented in our example on the transmission side. Use PPI to trigger a TASK_CAPTURE of the free run timer from COMPARE event of another timer (TIMER2) (You can ignore this, and trigger TASK_CAPTURE your way) Then use CPU to put the Captured value of the freerun timer to radio packet. Then TIMER2 will trigger the transmission of the radio after that using PPI. (This is important and shouldn't be ignored) The involvement of the CPU here is only to put the timestamp into radio packet. It wouldn't cause any un-predictable latency because we will use the TIMER2 and PPI to trigger radio. Most of the task is done using PPI and the latency is consistent.

Children
No Data
Related