<?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>nRF 51822 radio receive running error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8369/nrf-51822-radio-receive-running-error</link><description>I&amp;#39;m using nRF 51822 to develop a proprietary wireless protocol. 
 At Rx side, every 500ms have a listening window with 10ms to listen if there is package to receive. So 10ms is the time out of radio receive, if there is no package received, disable radio</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jul 2015 03:46:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8369/nrf-51822-radio-receive-running-error" /><item><title>RE: nRF 51822 radio receive running error</title><link>https://devzone.nordicsemi.com/thread/30366?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 03:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:403de748-accb-48ae-a4f3-338162c95efa</guid><dc:creator>JiachengWang</dc:creator><description>&lt;p&gt;The timeout is 10ms.&lt;/p&gt;
&lt;p&gt;Thanks a lot for your suggestion, I&amp;#39;ll try more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF 51822 radio receive running error</title><link>https://devzone.nordicsemi.com/thread/30365?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2015 15:23:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4403d623-b537-423e-b44f-448a59335a63</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jiacheng: How long is the timeout ?&lt;/p&gt;
&lt;p&gt;If you have an interrupt that can interrupt between the time you assign  initial_timer and the while loop code, then you can easily get a timeout, depend on how much time that interrupt handler uses.
Also if you are receiving something, I don&amp;#39;t think you will have the RADIO disabled immediately.&lt;/p&gt;
&lt;p&gt;I suggest you to put the assign initial_timer = NRF_RTC0-&amp;gt;COUNTER; right above the while loop. And maybe increase the timeout so that it should be OK when the code is preempted by the interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF 51822 radio receive running error</title><link>https://devzone.nordicsemi.com/thread/30364?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2015 02:29:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d37669e6-f195-40cb-9c71-b111d65c55ee</guid><dc:creator>JiachengWang</dc:creator><description>&lt;p&gt;Thanks a lot for your comment.&lt;/p&gt;
&lt;p&gt;With more debug, it seems the problem is in the &amp;quot;while&amp;quot; loop of radio disable. with following update of radio disable code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
  /* Disable radio */
  NRF_RADIO-&amp;gt;TASKS_DISABLE = 1U;
  while(NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
  {
	  /* radio disable time out */	
		if (((NRF_RTC0-&amp;gt;COUNTER - initial_timer) &amp;gt; (wait_time_out_ms + 1)) || (NRF_RTC0-&amp;gt;COUNTER &amp;lt; initial_timer))
		{		
#if (IF_PRINT_LOG)
      printf(&amp;quot;..................Radio disable time out in Rx..................\r\n&amp;quot; );
#endif
      /* system reset */
      NVIC_SystemReset( );
    }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;some time the radio disable is running time out. Because I have another function have higher priority than radio Rx listening, if the radio is interupted while it is listening, the radio disable has problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF 51822 radio receive running error</title><link>https://devzone.nordicsemi.com/thread/30363?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 09:16:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4257946-1bce-44d0-b6dc-43e4360c49e4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@JiachengWang: If you don&amp;#39;t use watchdog, in which loop would the program stuck in this function ? I don&amp;#39;t see any reason it should be stuck here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>