<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22049/time-synchronization-across-different-nodes-in-a-mesh-network-single-hop-as-well-as-multi-hop</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Jun 2017 12:32:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22049/time-synchronization-across-different-nodes-in-a-mesh-network-single-hop-as-well-as-multi-hop" /><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86551?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2017 12:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52870cb2-d6da-470e-bf20-8187d2f4665b</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;more or less in this manner. i have modified my code lately.&lt;/p&gt;
&lt;p&gt;but this seems feasible. will try to get the samples and see how it goes.then, i will get back.&lt;/p&gt;
&lt;p&gt;Thanks!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86550?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2017 12:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09a72183-d8f3-48da-a99e-82b261f2d18a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, you can implement that  ( I don&amp;#39;t see anything ab that in your source code) but then both device have to be in receiving mode all the time, so when you press the button to transmit it would be able to receive the packet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86549?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2017 09:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb5c839c-4f83-449e-bccc-34374c445618</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;hi
basically it goes like this:
In the main function, I call app button push (0) callback function.  The idea is to wait and listen for button or reception. If button, then transmit. If reception, then you are node 2 and probably want to transmit back&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86548?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2017 09:12:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f6174c-afa4-4723-a9c3-a05ded48c00b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;So you want to use the button to choose which role your device is ? Please clearly state the purpose of the button.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86547?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 15:07:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4365646-a15d-4033-85f0-805104c79692</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;have attached the appbutton.c file with the main.txt file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86546?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 15:05:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ccb2764-6a3f-4ed9-a09e-7778972c9f09</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;the led buttons on the board
in my main function i use the functionality&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86545?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 14:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d91e098-7e08-4276-b91c-8e950ee7e877</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;What do you mean by &amp;quot;button ticks&amp;quot; ? which button are you talking about here ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86544?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 14:13:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee0b98f-4ffb-4571-87d3-062b556f12a2</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;ya that could be done but what if we modify the button functionality to distinguish between the events, since i need to devise something different in my thesis work than what has been done.
can something be done about that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86543?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 13:56:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3618a2-4505-4fbf-9571-0160fb2cf12a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t think using same code works here. One must be the initiator and the other one response when it receive the first packet.&lt;/p&gt;
&lt;p&gt;I tried to explain you how the time stamp sampling and how we calculated the latency, add them up and put it to radio packet, several times in my comments earlier. Please try to test our example to understand how it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86542?ContentTypeID=1</link><pubDate>Wed, 31 May 2017 12:24:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97db6afb-3ac3-45fb-bdd0-303cb36222c1</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/button.txt"&gt;button.txt&lt;/a&gt;Hi
if i use the same code for both the transmitter and receiver, as  u saw in the earlier paper i sent u, there would be confusion regarding whether node 1 is transmitting to node 2 or node 2 is transmitting back to 1. Since there are 2 transmit and 2 receive events taking place in one full cycle as per the figure. How to fix this?
Probably one way could be that in the main function, i define which button ticks corresponding to which node.
But how to define it in the code.&lt;/p&gt;
&lt;p&gt;The second thing that i need to load the timestamp in the packet just before it is sent, where exactly the timestamp value loaded should be shown in my case ?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mainc.txt"&gt;mainc.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86541?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 10:40:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a2229b5-a995-4c42-9eb8-5d0eb7c97395</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If I understand you correctly, you want to generate the time stamp at exact moment when it&amp;#39;s sent from Node 1 , right ? It&amp;#39;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86540?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 15:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:584b8aac-f537-4a05-a50b-3002e0b2a16e</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86539?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 14:53:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8df2d1db-f94f-4a9b-a8a9-3e734b116190</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;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-&amp;gt;TASKS_START. They are individual hardware timers.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand this &amp;quot;generate a timestamp t_o just when the packet arrives at node 1&amp;quot; . What do you mean by arrive at node 1 ? I thought t_o is when you send the packet from node 1 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86538?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 12:44:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a2bf398-617d-429c-bd11-c9f722e8d74e</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86537?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 12:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7113c06a-e251-4729-bede-0ca0f0646833</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;Good enough. I will remain in touch with you on this if you don&amp;#39;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86536?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 11:07:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a3dabe-d764-460e-81c6-91f2a611e33e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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&amp;#39;t exceed the real time requirement.&lt;/p&gt;
&lt;p&gt;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&amp;#39;t be ignored)
The involvement of the CPU here is only to put the timestamp into radio packet. It wouldn&amp;#39;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86535?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 10:05:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9aa6920-258b-4309-901c-4e80383526fc</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;Also i would be just using capture events for capturing the event times. So no compare events will be involved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86534?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 09:49:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:822679e2-1322-48cd-b250-952a918e5e2f</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/01200555.pdf"&gt;01200555.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a part of my thesis work basically. I am using the tiny sync algorithm to achieve this.
Refer to fig 1 and then section 4 on page 1270.
basically i need to collect the three time stamps, t_o, t_b and t_r for each probe message sent. The packet itself would be carrying the timestamp to the destination.&lt;/p&gt;
&lt;p&gt;U mean to say that while using timers too for all events we would always be requiring the CPU. Although timers have the inbuilt functionality to minimize CPU intervention. There are probably some related tasks of Nordic in the SDK itself that have been done without using CPU. But i still need to figure out how to do the capture tasks independent of the CPU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86533?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 07:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4edda925-e129-45c7-9a96-8085f8a8c818</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes I can see start_reciever() but I don&amp;#39;t see when it&amp;#39;s called.&lt;/p&gt;
&lt;p&gt;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 ?&lt;/p&gt;
&lt;p&gt;Basically please explain what you meant here: &lt;code&gt;I wish to generate time stamps at each send and receive events between two different nodes for which i am using the nRF radio&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Note that this solution is only for a start network, where one single node can update multiple nodes around it. I don&amp;#39;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.&lt;/p&gt;
&lt;p&gt;And yes, we don&amp;#39;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86531?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 13:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52455609-6062-4d00-b4d9-82c6df744207</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;You can find the receiver functionality slightly above the main function. Since i am still experimenting on this, i was earlier thinking to collect the timestamp information (send and receive times) with the help of wireshark and analyser. But this won&amp;#39;t be precise enough since there is no idea of the clocks analyser is using and that wireshark receive times can&amp;#39;t be relied on. Although this could be done as a verification part only.
I now ought to add some more timer functionality to achieve this. But i had another query that if i use the capture functionality in hardware timer, how do i go about it without CPU intervention, as we are normally doing this by calling TASKS_CAPTURE for each capture event in the code. But this involves CPU. What&amp;#39;s the other CPU independent way for doing this.
Would appreciate your advice!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86530?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 12:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfd770e5-8235-4d4e-bf53-0172d2a2d9d8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;In your code I can&amp;#39;t see how the mesh work. You simply send broadcast data. What about the receiver? How does the mesh work ?? Is there any retransmission , rebroadcast ?? I don&amp;#39;t see in your code where you put the timestamp into the broadcast data, or maybe I misread it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86532?ContentTypeID=1</link><pubDate>Wed, 17 May 2017 10:14:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f233d50-fefd-49f9-8cc7-1c64251fc98c</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8030.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the code i would be using for my work. I looked at the link you gave me.
But it would be good if u could see mine and lemme know whether its appropriate enough.
As far as the main problem is concerned, my task is synchronizing all events in a mesh network.
I need to timestamp the events using hardware timers. Then once i have the time values, i can verify them by sniffing packets on air and seeing results on the Logic Analyzer. Then getting the data out from the board to the pc. Using certain algorithms to estimate the drift and the offset variations with regard to the time events recorded.
Hope this will clarify your queries.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86529?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 14:27:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7315c62b-8497-4ef5-b815-c8755668883c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please attach your code as a text file. Please have look again at your comment above, how would you expect me to read what you pasted ?&lt;/p&gt;
&lt;p&gt;You still haven&amp;#39;t described clearly enough what you are planing to do and what the difficulties you have. Please try to follow the tutorial and get back if you have issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86528?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 10:36:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a80f34f7-2ab5-4a89-84b8-a699a613ab3d</guid><dc:creator>khosla</dc:creator><description>&lt;p&gt;Thanks for this. Seems good enough as a guide!!!&lt;/p&gt;
&lt;p&gt;I am using the ppi code with radio in segger as seen below. Considering both the the transmit as well as receive cases in the same code. I have to collect the timestamps for each of the send as well as receive events for each of the two crystal oscillators, 16 MHz as well as 32.768 KHz XOSC as i mentioned earlier. Just let me know ur comments on how appropriate the code  is. Basically, my task is to synchronize between two neighboring nodes (single hop) as well as then extend this to synchronize between 7-8 nodes.&lt;/p&gt;
&lt;p&gt;Lemme know if something can be added in the code. One more thing is that i would be using only hardware clocks as you defined too, the timer and RTC.&lt;/p&gt;
&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;p&gt;/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
*&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The information contained herein is property of Nordic Semiconductor ASA.&lt;/li&gt;
&lt;li&gt;Terms and conditions of usage are described in detail in NORDIC&lt;/li&gt;
&lt;li&gt;SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;Licensees are granted free, non-transferable use of the information. NO&lt;/li&gt;
&lt;li&gt;WARRANTY of ANY KIND is provided. This heading must NOT be removed from&lt;/li&gt;
&lt;li&gt;the file.&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*/&lt;/p&gt;
&lt;p&gt;/** @file
*&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;@defgroup ppi_example_main main.c&lt;/li&gt;
&lt;li&gt;@{&lt;/li&gt;
&lt;li&gt;@ingroup ppi_example&lt;/li&gt;
&lt;li&gt;@brief PPI Example Application main file.&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;This file contains the source code for a sample application using PPI to communicate between timers.&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*/
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;nrf_drv_gpiote.h&amp;quot;
#include &amp;quot;SEGGER_RTT.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#define NRF_LOG_MODULE_NAME &amp;quot;APP&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;app_button.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#ifdef BSP_LED_0
#define GPIO_OUTPUT_PIN_NUMBER BSP_LED_0  /**&amp;lt; Pin number for output. */
#endif
#ifndef GPIO_OUTPUT_PIN_NUMBER
#error &amp;quot;Please indicate output pin&amp;quot;
#endif&lt;/p&gt;
&lt;p&gt;uint32_t counter = 0;&lt;/p&gt;
&lt;p&gt;const nrf_drv_timer_t timer0 = NRF_DRV_TIMER_INSTANCE(0);
const nrf_drv_timer_t timer1 = NRF_DRV_TIMER_INSTANCE(1);
const nrf_drv_timer_t timer2 = NRF_DRV_TIMER_INSTANCE(2);&lt;/p&gt;
&lt;p&gt;static uint32_t *radio_register = (uint32_t *) 0x40001000;
nrf_ppi_channel_t ppi_channel1, ppi_channel2, ppi_channel3, ppi_channel4, ppi_channel5, ppi_channel6, ppi_channel7, ppi_channel8, ppi_channel9, ppi_channel10, ppi_channel11, ppi_channel11, ppi_channel12, ppi_channel13;&lt;/p&gt;
&lt;p&gt;// Timer even handler. Not used since timer is used only for PPI.
void timer_event_handler(nrf_timer_event_t event_type, void * p_context){}&lt;/p&gt;
&lt;p&gt;/** @brief Function for initializing the PPI peripheral.
*/
static void ppi_init(void)
{
uint32_t err_code = NRF_SUCCESS;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = nrf_drv_ppi_init();
APP_ERROR_CHECK(err_code);

// Configure 1st available PPI channel to stop TIMER0 counter on TIMER1 COMPARE[0] match, which is every even number of seconds.
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel1);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel1,
                                      nrf_drv_timer_event_address_get(&amp;amp;timer1, NRF_TIMER_EVENT_COMPARE0),
                                      nrf_drv_timer_task_address_get(&amp;amp;timer0, NRF_TIMER_TASK_STOP));
APP_ERROR_CHECK(err_code);

// Configure 2nd available PPI channel to start timer0 counter at TIMER2 COMPARE[0] match, which is every odd number of seconds.
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel2);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel2,
                                      nrf_drv_timer_event_address_get(&amp;amp;timer2, NRF_TIMER_EVENT_COMPARE0),
                                      nrf_drv_timer_task_address_get(&amp;amp;timer0, NRF_TIMER_TASK_START));
APP_ERROR_CHECK(err_code);
// Enable both configured PPI channels
err_code = nrf_drv_ppi_channel_enable(ppi_channel1);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel2);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/** @brief Function for Timer 0 initialization, which will be started and stopped by timer1 and timer2 using PPI.
*/
static void timer0_init(void)
{
nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_cfg.mode = NRF_TIMER_MODE_COUNTER;
ret_code_t err_code = nrf_drv_timer_init(&amp;amp;timer0, &amp;amp;timer_cfg, timer_event_handler);
APP_ERROR_CHECK(err_code);
}&lt;/p&gt;
&lt;p&gt;/** @brief Function for Timer 1 initialization.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;@details Initializes Timer 1 peripheral, creates event and interrupt every 2 seconds,&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      by configuring CC[0] to timer overflow value, we create events at even number of seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      for example, events are created at 2,4,6 ... seconds. This event can be used to stop Timer 0
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      with Timer1-&amp;gt;Event_Compare[0] triggering Timer 0 TASK_STOP through PPI.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*/
static void timer1_init(void)
{
// Configure Timer 1 to overflow every 2 seconds. Check TIMER1 configuration for details
// The overflow occurs every 0xFFFF/(SysClk/2^PRESCALER).
// = 65535/31250 = 2.097 sec
nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
ret_code_t err_code = nrf_drv_timer_init(&amp;amp;timer1, &amp;amp;timer_cfg, timer_event_handler);
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_timer_extended_compare(&amp;amp;timer1, NRF_TIMER_CC_CHANNEL0, 0xFFFFUL, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/** @brief Function for Timer 2 initialization.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;@details Initializes Timer 2 peripheral, creates event and interrupt every 2 seconds&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      by configuring CC[0] to half of timer overflow value. Events are created at odd number of seconds.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      For example, events are created at 1,3,5,... seconds. This event can be used to start Timer 0
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;      with Timer2-&amp;gt;Event_Compare[0] triggering Timer 0 TASK_START through PPI.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*/
static void timer2_init(void)
{
// Generate interrupt/event when half of time before the timer overflows has past, that is at 1,3,5,7... seconds from start.
// Check TIMER1 configuration for details
// now the overflow occurs every 0xFFFF/(SysClk/2^PRESCALER)
// = 65535/31250 = 2.097 sec */
nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
ret_code_t err_code = nrf_drv_timer_init(&amp;amp;timer2, &amp;amp;timer_cfg, timer_event_handler);
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_timer_extended_compare(&amp;amp;timer2, NRF_TIMER_CC_CHANNEL0, 0x7FFFUL, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;@brief Function for application main entry.
*/&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;uint32_t low_mask(char n) {
return (1&amp;lt;&amp;lt;(n+1)) - 1;
}&lt;/p&gt;
&lt;p&gt;void set_address0(uint32_t address) {
uint32_t base = address &amp;lt;&amp;lt; 8;
NRF_RADIO-&amp;gt;BASE0 = base;
uint32_t prefix = (address &amp;gt;&amp;gt; 24) &amp;amp; low_mask(8);
NRF_RADIO-&amp;gt;PREFIX0 = prefix;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;void radio_init(){
uint32_t err_code = NRF_SUCCESS;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Set frequency, advertising channel 37. 
NRF_RADIO-&amp;gt;FREQUENCY = 2UL;  // Frequency bin 2, 2402MHz

//Set whitening to same as channel
NRF_RADIO-&amp;gt;DATAWHITEIV = 37;
NRF_RADIO-&amp;gt;TXADDRESS = 0; //Base0 + prefix0
NRF_RADIO-&amp;gt;RXADDRESSES = 1;

//Set TXPOWER
NRF_RADIO-&amp;gt;TXPOWER = RADIO_TXPOWER_TXPOWER_0dBm;

 uint32_t override_val = NRF_FICR-&amp;gt;OVERRIDEEN &amp;amp; FICR_OVERRIDEEN_BLE_1MBIT_Msk;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;if (override_val == FICR_OVERRIDEEN_BLE_1MBIT_Override) {
NRF_RADIO-&amp;gt;OVERRIDE0 = NRF_FICR-&amp;gt;BLE_1MBIT[0];
NRF_RADIO-&amp;gt;OVERRIDE1 = NRF_FICR-&amp;gt;BLE_1MBIT[1];
NRF_RADIO-&amp;gt;OVERRIDE2 = NRF_FICR-&amp;gt;BLE_1MBIT[2];
NRF_RADIO-&amp;gt;OVERRIDE3 = NRF_FICR-&amp;gt;BLE_1MBIT[3];
NRF_RADIO-&amp;gt;OVERRIDE4 = NRF_FICR-&amp;gt;BLE_1MBIT[4];
}&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_RADIO-&amp;gt;MODE = RADIO_MODE_MODE_Nrf_1Mbit;

//Set CRC initial value
NRF_RADIO-&amp;gt;CRCINIT = 0x555555;
//Set CRC size and address include
NRF_RADIO-&amp;gt;CRCCNF = 
        (3 &amp;lt;&amp;lt; RADIO_CRCCNF_LEN_Pos)  |
        (true &amp;lt;&amp;lt; RADIO_CRCCNF_SKIPADDR_Pos);

NRF_RADIO-&amp;gt;CRCPOLY = (1&amp;lt;&amp;lt;24) | (1&amp;lt;&amp;lt;10) | (1&amp;lt;&amp;lt;9) | (1&amp;lt;&amp;lt;6) | (1&amp;lt;&amp;lt;4) | (1&amp;lt;&amp;lt;3) | (1&amp;lt;&amp;lt;1) | 1;

//Set size of length, s0 and s1
NRF_RADIO-&amp;gt;PCNF0 =
        (1 &amp;lt;&amp;lt; RADIO_PCNF0_S0LEN_Pos) |
        (6 &amp;lt;&amp;lt; RADIO_PCNF0_LFLEN_Pos) |
        (2 &amp;lt;&amp;lt; RADIO_PCNF0_S1LEN_Pos);

NRF_RADIO-&amp;gt;PCNF1 = 
        (100 &amp;lt;&amp;lt; RADIO_PCNF1_MAXLEN_Pos) |
        (0 &amp;lt;&amp;lt; RADIO_PCNF1_STATLEN_Pos)  |
        (3 &amp;lt;&amp;lt; RADIO_PCNF1_BALEN_Pos)    |
        (RADIO_PCNF1_ENDIAN_Little &amp;lt;&amp;lt; RADIO_PCNF1_ENDIAN_Pos)   |
        (true &amp;lt;&amp;lt; RADIO_PCNF1_WHITEEN_Pos);

//Set Radio address
set_address0(0x8E89BED6);


NRF_RADIO-&amp;gt;SHORTS = 
        (1 &amp;lt;&amp;lt; RADIO_SHORTS_END_DISABLE_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void timer_init(){
uint32_t err_code;
//Configure timer and compare for timer0
nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_24;
timer_cfg.frequency = NRF_TIMER_FREQ_1MHz;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = nrf_drv_timer_init(&amp;amp;timer0, &amp;amp;timer_cfg, timer_event_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_timer_extended_compare(&amp;amp;timer0, NRF_TIMER_CC_CHANNEL0, 5, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);


//Configure Timer SHORTS
NRF_TIMER0-&amp;gt;SHORTS = (TIMER_SHORTS_COMPARE0_STOP_Enabled &amp;lt;&amp;lt; TIMER_SHORTS_COMPARE0_STOP_Pos);

nrf_drv_timer_enable(&amp;amp;timer0);
nrf_drv_timer_enable(&amp;amp;timer1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void ppi_init_new(){&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ret_code_t err_code = nrf_drv_gpiote_init();
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_init();
APP_ERROR_CHECK(err_code);





//Config event task
nrf_drv_gpiote_out_config_t task_config4 = GPIOTE_CONFIG_OUT_TASK_TOGGLE(true);
ret_code_t err_code2 = nrf_drv_gpiote_out_init(24, &amp;amp;task_config4);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_out_config_t task_config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(true);
err_code2 = nrf_drv_gpiote_out_init(23, &amp;amp;task_config);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_out_config_t task_config2 = GPIOTE_CONFIG_OUT_TASK_TOGGLE(true);
err_code2 = nrf_drv_gpiote_out_init(22, &amp;amp;task_config2);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_out_config_t task_config3 = GPIOTE_CONFIG_OUT_TASK_TOGGLE(true);
err_code2 = nrf_drv_gpiote_out_init(21, &amp;amp;task_config3);
APP_ERROR_CHECK(err_code);


uint32_t gpiote_task_addr = nrf_drv_gpiote_out_task_addr_get(23);
// Configure 1st available PPI channel to stop TIMER0 counter on TIMER1 COMPARE[0] match, which is every even number of seconds.





//Usefull PPI Channels that trigger important things
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel13);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel13,
                                      nrf_drv_timer_event_address_get(&amp;amp;timer0, NRF_TIMER_EVENT_COMPARE0),
                                      nrf_drv_gpiote_out_task_addr_get(22));
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;/*
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel5);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel5,
NRF_RADIO-&amp;gt;EVENTS_READY,
NRF_TIMER0-&amp;gt;TASKS_START);
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;/*
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel11);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel11,
nrf_drv_timer_event_address_get(&amp;amp;timer1, NRF_TIMER_EVENT_COMPARE0),
NRF_RADIO-&amp;gt;TASKS_STOP);
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel12);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel12,
                                      NRF_RADIO-&amp;gt;EVENTS_ADDRESS,
                                      NRF_TIMER1-&amp;gt;TASKS_STOP);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;*/&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//PPI Channels Used for debugging
err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel1);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel1,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY), //(uint32_t) (0x40001000+0x104), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY),
                                      gpiote_task_addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel6);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel6,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_ADDRESS), //(uint32_t) (0x40001000+0x104), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY),
                                      gpiote_task_addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel2);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel2,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_PAYLOAD), //(uint32_t) (0x40001000+0x108), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_END),
                                      gpiote_task_addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel3);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel3,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_END),
                                      gpiote_task_addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel4);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel4,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_DISABLED),
                                      gpiote_task_addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel7);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel7,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY), //(uint32_t) (0x40001000+0x104), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY),
                                      nrf_drv_gpiote_out_task_addr_get(21));
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel8);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel8,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_ADDRESS), //(uint32_t) (0x40001000+0x104), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY),
                                      nrf_drv_gpiote_out_task_addr_get(21));
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel9);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel9,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_PAYLOAD), //(uint32_t) (0x40001000+0x108), //(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_END),
                                      nrf_drv_gpiote_out_task_addr_get(21));
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;ppi_channel10);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_assign(ppi_channel10,
                                      (uint32_t) (&amp;amp;NRF_RADIO-&amp;gt;EVENTS_END),
                                      nrf_drv_gpiote_out_task_addr_get(21));




//Enable ppi
err_code = nrf_drv_ppi_channel_enable(ppi_channel1);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel2);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel3);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel4);
APP_ERROR_CHECK(err_code);   
err_code = nrf_drv_ppi_channel_enable(ppi_channel5);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel6);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel7);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel8);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel9);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_enable(ppi_channel10);
APP_ERROR_CHECK(err_code);


err_code = nrf_drv_ppi_channel_enable(ppi_channel13);
APP_ERROR_CHECK(err_code);



//nrf_drv_gpiote_out_task_enable(23);
nrf_drv_gpiote_out_task_enable(21);
nrf_drv_gpiote_out_task_enable(22);
nrf_drv_gpiote_out_task_enable(23);
nrf_drv_gpiote_out_task_enable(24);

//Start clock 0

//nrf_gpio_cfg_output(23);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void start_crystal_clock(){
// Start 16 MHz crystal oscillator
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
* (int *) 0x40000000 = 1;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wait for the external oscillator to start up 
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
{
    // Do nothing.
}
 /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
NRF_CLOCK-&amp;gt;LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART    = 1;

while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
{
    // Do nothing.
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void send_adv_ind(char* adv_packet){
//NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t) adv_packet;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Set packet pointer
NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t) adv_packet;

NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
NRF_RADIO-&amp;gt;EVENTS_READY = 0U;
NRF_RADIO-&amp;gt;TASKS_TXEN   = 1U;
while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)
{
    // wait
}

NRF_RADIO-&amp;gt;TASKS_START = 1U;

while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
{
    // wait
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void send_packet(char* send_packet){
//NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t) adv_packet;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Set packet pointer
NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t) send_packet;

NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
NRF_RADIO-&amp;gt;EVENTS_READY = 0U;
NRF_RADIO-&amp;gt;TASKS_TXEN   = 1U;
while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)
{
    // wait
}


while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
{
    // wait
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void start_reciever(char* recieve_packet){
//Set packet pointer
NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t) recieve_packet;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_RADIO-&amp;gt;EVENTS_READY = 0U;
// Enable radio and wait for ready
NRF_RADIO-&amp;gt;TASKS_RXEN = 1U;
while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)
{
    // wait
}

NRF_RADIO-&amp;gt;EVENTS_END = 0U;
// Start listening and wait for address received event
NRF_RADIO-&amp;gt;TASKS_START = 1U;

// Wait for end of packet or buttons state changed
while (NRF_RADIO-&amp;gt;EVENTS_END == 0U)
{
    // wait
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void send_scan_res(char* scan_res_packet){&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
NRF_RADIO-&amp;gt;EVENTS_READY = 0U;
NRF_RADIO-&amp;gt;TASKS_TXEN   = 1U;
while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)
{
    // wait
}

//NRF_RADIO-&amp;gt;TASKS_START = 1U;

while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
{
    // wait
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;#define BUTTON_DETECTION_DELAY          10&lt;/p&gt;
&lt;p&gt;static volatile uint16_t button_tick = 0;
static volatile uint16_t button_min_hand = 0;
static volatile bool button_pressed = false;&lt;/p&gt;
&lt;p&gt;static void button_handler(uint8_t button, uint8_t action)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch(action) {
case APP_BUTTON_PUSH:
    button_pressed = true;
    break;
case APP_BUTTON_RELEASE:
    button_pressed = false;
    //SEGGER_RTT_printf(0, &amp;quot;button_ticks are: %d, button_min_hand is %d\n&amp;quot;, button_tick, button_min_hand);
    button_tick = 0;
    button_min_hand = 0;
    break;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void buttons_init(void)
{
uint32_t err_code = 0;
static app_button_cfg_t buttons[] = {
{1, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}
};
err_code = app_button_init((app_button_cfg_t *)buttons,
sizeof(buttons) / sizeof(buttons[0]),
BUTTON_DETECTION_DELAY);
APP_ERROR_CHECK(err_code);
err_code = app_button_enable();
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void button_tick_increment(void)
{
if (button_pressed == true) {
if (button_tick &amp;gt;= 65534) {
button_min_hand++;
button_tick = 0;
}
button_tick++;
}
}&lt;/p&gt;
&lt;p&gt;int main(void)
{/*
//0b00000010      //Device address: 0xee, 0x1c, 0x35, 0x21, 0x03, 0xf1, sent LSByte first
uint8_t adv_packet[100] = {0b01000000, 15, 0, 0xee, 0x03, 0x21, 0x35, 0x1c, 0xee, 8, 0x09, &amp;#39;N&amp;#39;,&amp;#39;i&amp;#39;,&amp;#39;c&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;a&amp;#39;,&amp;#39;i&amp;#39;};
uint8_t recieve_packet[100] = {0};
uint8_t scan_res_packet[100] = {0b01000100, 16, 0, 0xf1, 0x03, 0x21, 0x35, 0x1c, 0xee, 9, 0x09, &amp;#39;R&amp;#39;,&amp;#39;e&amp;#39;,&amp;#39;s&amp;#39;,&amp;#39;p&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39;n&amp;#39;,&amp;#39;s&amp;#39;, &amp;#39;e&amp;#39;};
*/&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//power_manage();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}
int  button_tick = 0;
uint32_t err_code;
//ppi_init_new();
radio_init();
start_crystal_clock();
timer_init();&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; NRF_GPIO-&amp;gt;DIRSET = (1 &amp;lt;&amp;lt; 21) | (1 &amp;lt;&amp;lt; 22) | (1 &amp;lt;&amp;lt; 23) | (1 &amp;lt;&amp;lt; 24);
NRF_GPIO-&amp;gt;OUTCLR = (1 &amp;lt;&amp;lt; 21) | (1 &amp;lt;&amp;lt; 22) | (1 &amp;lt;&amp;lt; 23) | (1 &amp;lt;&amp;lt; 24);
int tick = 0;
int b = 2;

uint8_t v_nr_1 = 0;
uint8_t v_nr_2 = 0;
uint8_t mesh_demo_packet[] = {0b01000000, 15, 0, 0xee, 0x03, 0x21, 0x35, 0x1c, 0xee, 0x07, 0x09, &amp;#39;R&amp;#39;,&amp;#39;a&amp;#39;,&amp;#39;g&amp;#39;,&amp;#39;h&amp;#39;,&amp;#39;a&amp;#39;,&amp;#39;v&amp;#39;};
while(b == 2){
  
    send_adv_ind(mesh_demo_packet);
    if(v_nr_1 &amp;gt;= 255){
        v_nr_1 = 0;
        v_nr_2++;
    }else{
        v_nr_1++;
    }
    
    nrf_delay_ms(100);
} 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/** @} */&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: time synchronization across different nodes in a mesh network, single hop as well as multi hop.</title><link>https://devzone.nordicsemi.com/thread/86527?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 08:56:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a8338bc-c6d5-448d-8b37-0ffd9d56567e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Khosla,&lt;/p&gt;
&lt;p&gt;How do you plan to connect your mesh network ? How would the re-transmission between nodes in the network work ?&lt;/p&gt;
&lt;p&gt;It you only plan to synchronize between 2 device (or multiple devices but not mesh) you can have a look &lt;a href="https://devzone.nordicsemi.com/blogs/978/wireless-timer-synchronization-among-nrf5-devices/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>