<?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>Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2346/synchronisation-with-advertisement</link><description>Hello, 
 Im trying to create a synchronisation method for sensors using BLE. At the moment i can synchronise them within 10ms accuracy, in theory it should be within 2ms and i can not find this 7ms extra delay. This is my current synchronisation method</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Jun 2014 05:30:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2346/synchronisation-with-advertisement" /><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9649?ContentTypeID=1</link><pubDate>Fri, 27 Jun 2014 05:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f202abd1-c34b-4818-9dcc-08cc9844516a</guid><dc:creator>Knut Eldhuset</dc:creator><description>&lt;p&gt;That would probably be the case. I see you have been able to solve the problem by increasing the radio notification time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9646?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2014 16:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:563ce1e8-42a2-48cf-adb6-f93de9e9b67e</guid><dc:creator>pascal defesche</dc:creator><description>&lt;p&gt;Softdevice was not causing this delay. My radio notification was to short, so my current advertisement was sent next adv interval. Setting radio notification towards max solved my problem.
Im now able to synchronise two devices within an accuracy of 2ms. Nordic told me in future stack release they will implement a way you can advertise on only 1 channel, so 2ms error can be eliminated in future. Hope this helps others&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9648?ContentTypeID=1</link><pubDate>Wed, 28 May 2014 05:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67013c8a-9030-4330-a9d2-9c2004570763</guid><dc:creator>pascal defesche</dc:creator><description>&lt;p&gt;Wont the radio notification give me an exact callback to mcu when radio gets active in 1,74ms? So this advDelay included.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9647?ContentTypeID=1</link><pubDate>Tue, 27 May 2014 05:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec3faa2c-08d0-4ae6-9467-ddcd1cb5b2c1</guid><dc:creator>Knut Eldhuset</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From the Bluetooth Spec 4.1, Volume 6, Part B, section 4.4.2.2 &amp;quot;Advertising Interval,&amp;quot; you can see that the time between consecutive advertising events (T_advEvent) is:&lt;/p&gt;
&lt;p&gt;T_advEvent = advInterval + advDelay&lt;/p&gt;
&lt;p&gt;advDelay is a pseudo-random value ranging from 0ms to 10ms. I think you will not be able to get rid of the 10ms jitter with your method of synchronization.&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9645?ContentTypeID=1</link><pubDate>Mon, 26 May 2014 09:20:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:681772c4-d667-4f89-9923-1921de0c7bd3</guid><dc:creator>pascal defesche</dc:creator><description>&lt;p&gt;Made a little progress on this case: i keep reading the timer in my main loop and set this time as advertising data instead of using the radio notification(like in my posts before). So it keeps updating the advertising data until it cannot update anymore because the radio gets active. The synchronisation protocol works much better in this way: most of the time i can see a synchronisation of Δt = 2ms. Sometimes i see a little jitter towards 10ms, but still cannot explain this.&lt;/p&gt;
&lt;p&gt;My question to Nordic: Is the softdevice causing this unexpected delay? Why does the radio notification not give me a constant delay?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Synchronisation with advertisement</title><link>https://devzone.nordicsemi.com/thread/9644?ContentTypeID=1</link><pubDate>Fri, 02 May 2014 07:26:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d143279a-98d5-4e6b-ba97-bfc63a68205b</guid><dc:creator>pascal defesche</dc:creator><description>&lt;p&gt;In the above method at each compare IRQ i cleared the timer and restart counting from 0 towards 31250. I thought maybe the clear task is not being executed exactly at count value 31250. If a bluetooth event comes at IRQ the timer will not be cleared and for example counts toward 3250 and gets cleared.&lt;/p&gt;
&lt;p&gt;So now instead of clearing the timer at each compare IRQ im just setting new compare value with: CC[0] += 31250. I use CC[1] to capture the timervalue and put it in currentvalue. I calculate the time needed towards a new interrupt as follow:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_TIMER1-&amp;gt;TASKS_CAPTURE[1] = 1; //capture timer value
currentvalue = (NRF_TIMER1-&amp;gt;CC[1]); //value in us
if(currentvalue&amp;gt;NRF_TIMER1-&amp;gt;CC[0])
{
    currentvalue = 65535-currentvalue + NRF_TIMER1-&amp;gt;CC[0];
}
else
{
currentvalue = NRF_TIMER1-&amp;gt;CC[0] - currentvalue;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At the S120 device i calculate his time value towards next IRQ. At the next IRQ of the S120 device i update the compare register with:
&lt;code&gt;NRF_TIMER1-&amp;gt;CC[0] += TIMER1_CC_DELAY - difference;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In theory i would expect the IRQs to be executed at exactly the same time. Still i&amp;#39;m getting the same results as my first test: Δt = 10ms jitter instead of 2ms jitter. Does someone know what causes this unexpected delay? All help will be appreciated!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>