<?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>Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59806/modifying-wireless-timer-sync-using-rtc</link><description>Hello, 
 I&amp;#39;m modifying the code of Wireless timer synchronization among nRF5 devices blog to use RTC instead of two TIMERs. I started with the code on Git for SDK 16. Writing for nRF52832. 
 Timers on multiple nRF5 devices are synced by one device (master</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 23 Jun 2024 05:39:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59806/modifying-wireless-timer-sync-using-rtc" /><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/490102?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2024 05:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a75631b4-33e8-42ba-a5b2-24fb41704cf9</guid><dc:creator>simon.jonghun.song</dc:creator><description>&lt;p&gt;FYI&lt;/p&gt;
&lt;p&gt;Zephyr BLE code for radio.&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/intel/zephyr/blob/main/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c"&gt;https://github.com/intel/zephyr/blob/main/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/483354?ContentTypeID=1</link><pubDate>Tue, 14 May 2024 19:38:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:874f38c7-fa80-4b3e-b5d2-27f5e6ecd620</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Blog moved:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/wireless-timer-synchronization-among-nrf5-devices"&gt;wireless-timer-synchronization-among-nrf5-devices&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/245101?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 00:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1d60ac3-b27d-4bdb-975d-a640297747da</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Susheel for the Zephyr link. What a great book opportunity to explain all the nRF5 peripherals for those new to the platform. If only I had the time ...&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/244997?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 12:38:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e45fe684-58a9-445a-8c4a-4596f80cc895</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am afraid there is no step by step guide on this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But I found that the zephyr source code can be used to understand how to configure the registers.&lt;/p&gt;
&lt;p&gt;Please take a look at RADIO configuration in Zephyr BLE &lt;a href="https://github.com/intel/zephyr/blob/master/subsys/bluetooth/controller/hal/nrf5/radio.c"&gt;code&lt;/a&gt;. Even though this is desgined for BLE specific part, the register configuration shows how radio configuration can be adapted for other protocols&amp;nbsp; as well. Please pay attention to&amp;nbsp;&lt;strong&gt;&lt;span&gt;radio_filter_configure&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/244799?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 16:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:679da0db-887f-4be6-8e92-6dadf0c79327</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thank you Susheel. I did try changing:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t rf_address[5] = {0xDE, 0xAD, 0xBE, 0xEF, 0x19};
// Radio address config
NRF_RADIO-&amp;gt;PREFIX0 = rf_address[0];
NRF_RADIO-&amp;gt;BASE0 = (rf_address[1] &amp;lt;&amp;lt; 24 | rf_address[2] &amp;lt;&amp;lt; 16 | rf_address[3] &amp;lt;&amp;lt; 8 | rf_address[4]);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t rf_address[5] = {0xDE, 0xAD, 0xBE, 0xEF, 0x10};
// Radio address config
NRF_RADIO-&amp;gt;PREFIX0 = rf_address[0];
NRF_RADIO-&amp;gt;BASE0 = (rf_address[1] &amp;lt;&amp;lt; 24 | rf_address[2] &amp;lt;&amp;lt; 16 | rf_address[3] &amp;lt;&amp;lt; 8 | rf_address[4]);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;for a second system (note change in last byte of rf_address) and found, as expected, that packets transmitted from a peripheral using the first address array are not received by peripherals listening with second address array.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What you say suggests to me that white listing and DAB/DAP can be helpful to reduce noise and interference between two systems of devices. I&amp;#39;m actually new to NRF_RADIO and am not experienced with this topic. If you know of any helpful learning resources for radio addressing, white listing, DAB/DAP, I would be grateful.&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/244588?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 06:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a4b0fe9-be42-4cf1-988d-b0014775a830</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Tim,&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]The code needs to also allow for multiple &amp;quot;systems&amp;quot; used in close proximity and need to be sure one system of devices does not interfere with another system of devices when listening for or sending sync packets.[/quote]
&lt;p&gt;I would say that using a unique serial number per &amp;quot;System&amp;quot; as part of the device address and if you can use the DAB/DAP feature to whitelist the incoming packets. would reduce noise from neighbouring systems considerably at the hardware RX level itself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t experimented with this, but I am quite confident that this can be easily achievable considering that you have a quite deep understanding of the hardware already.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/244228?ContentTypeID=1</link><pubDate>Fri, 10 Apr 2020 17:02:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccded039-fc9f-402b-a2f9-5439a9972d54</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Susheel. Given no other considerations for frequency, I&amp;#39;ll just use 50.&lt;/p&gt;
&lt;p&gt;Would also appreciate some guidance regarding radio address configuration. Our product is a mobile timing system where one &amp;quot;system&amp;quot; comprises 2, 3 or 4 peripheral devices. These will use this method of syncing clocks. I have it working well using RTC instead of two TIMERs giving the required accuracy.&lt;/p&gt;
&lt;p&gt;The code needs to also allow for multiple &amp;quot;systems&amp;quot; used in close proximity and need to be sure one system of devices does not interfere with another system of devices when listening for or sending sync packets. I presume that the devices of each system can simply use a different radio address. Each peripheral device has a unique serial number (uint16) and I presume I can construct a unique radio address based on the serial number of one of the peripherals in a system of devices. Reasonable?&lt;/p&gt;
&lt;p&gt;Would appreciate any guidance about this. How best to construct a unique address and configure the appropriate address registers (NRF_RADIO-&amp;gt;PREFIX0 and&amp;nbsp;NRF_RADIO-&amp;gt;BASE0).&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/243643?ContentTypeID=1</link><pubDate>Mon, 06 Apr 2020 12:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eedd8af-b105-4de4-88f6-473811392776</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I would suggest you to change the freqency in the mid sweep bandwidth. That is in betweel 40-60 instead of 125. Even though the hardware seems to still support the value for testing purpose, 125 is not officially supported. So for your production code use the value below 100.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/243264?ContentTypeID=1</link><pubDate>Thu, 02 Apr 2020 18:56:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec712585-91ef-4289-9a29-7a065b737cbd</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thank you Susheel. Another thought ... for capturing local RTC counter when receiving sync packets, I could use PPI and an available timer to time from NRF_RADIO-&amp;gt;EVENTS_ADDRESS to&amp;nbsp;RADIO_IRQHandler() invocation (event NRF_RADIO-&amp;gt;EVENTS_ADDRESS, task NRF_TIMER4-&amp;gt;TASKS_START). I&amp;#39;m looking for millisecond accuracy, so I imagine this time will be negligible.&lt;/p&gt;
&lt;p&gt;Could I ask you or Audun to respond to my other question about NRF_RADIO-&amp;gt;FREQUENCY? The blog post code has&amp;nbsp;&lt;em&gt;ts_params.rf_chn = 125;&amp;nbsp;&lt;strong&gt;/* For testing purposes */&lt;/strong&gt;&lt;/em&gt;. This makes me wonder what must be considered when designing code for production. And in general, any other considerations when integrating this great blog post into a production product. I&amp;#39;m relatively new to direct manipulation of NRF_RADIO via time slots.&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying wireless timer sync using RTC</title><link>https://devzone.nordicsemi.com/thread/243241?ContentTypeID=1</link><pubDate>Thu, 02 Apr 2020 15:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b08c03f-a299-4bd0-9fd7-14ff93d14867</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I shared your code changes to the actual author of the code in the link you provided in &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/wireless-timer-synchronization-among-nrf5-devices" rel="noopener noreferrer" target="_blank"&gt;Wireless timer synchronization among nRF5 devices blog&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you figured out PPI cannot be used to capture RTC counter, and since RTC resolution is relatively low as compared to TIMER, so it should still be ok to have a bit of software latency.&lt;/p&gt;
&lt;p&gt;Capturing the time offset from the master on each of the nodes makes a lot of sense. You could make operations on the m_rtc_counter_offset atomic&amp;nbsp;variable inside the RAM to make the timestamp calculation a bit faster. Other than that, the code looks good to Audun (the author of the blog) and it also looks good to me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>