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.

  • Good enough. I will remain in touch with you on this if you don't mind. The CPU intervention problem is solved by using the the PPI itself. But perhaps i need to in initialize it earlier in the process so as to avoid delay. But when we are using timer 0, 1 and 2, are these individual timers present at each of the nodes or these are just separate instances of the same timer on one node. Because as u mentioned we are using one timer and one RTC for each node right.

  • Also as per the algorithm, i need to generate a timestamp t_o just when the packet arrives at node 1. So will it be done using a timer itself and if yes, at what point in the code i need to load the timestamp in the packet.

  • In our example we use 2 TIMERs to improve accuracy. The time stamp is only taken on one timer (the free runner) the other timer is just to do the task of triggering TASK_CAPTURE and RADIO->TASKS_START. They are individual hardware timers.

    I don't understand this "generate a timestamp t_o just when the packet arrives at node 1" . What do you mean by arrive at node 1 ? I thought t_o is when you send the packet from node 1 ?

  • ya but if u see fig 1 in the doc, u see t_o as the the time of send event being generated at node 1 interface. t_o being the time just before the packet is sent as labelled. i propose to follow the algorithm but will make some modifications at later stages in this algorithm. you are right. i wrote it the wrong way. sorry!!!! now i will try working on this the coming weekend and then discuss further if required. thanks alot for ur support.

  • If I understand you correctly, you want to generate the time stamp at exact moment when it's sent from Node 1 , right ? It's impossible to capture the timer at exact time when the packet is sent and put it into the radio packet at the same time. But we can do calculation and estimate the exact value of the timer when the radio packet is sent. The number of cycles from the time we capture the timer value until the time we trigger TASK_START on the radio is determined (by using the second timer and PPI), so we can calculate the exact time stamp.

Related