<?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>nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20065/nrf52-radio-bit-counter</link><description>Hello, recently I&amp;#39;ve found an information about bit counter in Radio Module in nRF52 Product Specification. Unfortunatelly I can&amp;#39;t find any reference at infocenter how to use it, neither can I find any example in the Internet or SDK. 
 In my project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Mar 2017 08:32:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20065/nrf52-radio-bit-counter" /><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78100?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 08:32:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e366e9f-70f2-4324-9f5e-1b0a81641778</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Oskar&lt;br /&gt;
Yes, events are used to generate interrupts. First you have to allow that event to create interrupts by setting the right bit in the NRF_RADIO-&amp;gt;INTENSET register, enable the interrupt for the radio peripheral itself, and implement the interrupt handler.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_RADIO-&amp;gt;INTENSET = RADIO_INTENSET_END_Msk;        
NVIC_EnableIRQ(RADIO_IRQn);     
     
void RADIO_IRQHandler(void)           
{        
  if(NRF_RADIO-&amp;gt;EVENTS_END)       
  {         
    NRF_RADIO-&amp;gt;EVENTS_END = 0;        
    // Count the events here      
  }        
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78099?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 10:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1f0f3a6-4a86-4e47-9ffa-39d06dccc995</guid><dc:creator>Oskar Baginski</dc:creator><description>&lt;p&gt;Well I have one more question, how to count END events? I thought about checking value of the certain register but it requires timer(very fast actually) and using one is not an option. Does END event equal interrupt so I could handle it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78101?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 07:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c017c96-023c-4ca1-a27c-db7b12100ae5</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I am glad to hear it. The best of luck on your project :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78098?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 18:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d54162-dc1f-4da5-976a-d920a0a0b1d4</guid><dc:creator>Oskar Baginski</dc:creator><description>&lt;p&gt;Yes indeed, I&amp;#39;m working on my own protocol and I think the biggest obstacle I faced has been defeated thanks to your advice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78097?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 15:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d17abc2-4e0c-45e1-8d23-b3f34d74d61b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;If you are making your own protocol then it&amp;#39;s definitely an option.
If you are using one of our libraries, such as nrf_esb.c or Gazell, then I  think it&amp;#39;s easier just to update a variable in the TX callback function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78096?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 15:48:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b4760f3-4864-4ace-81d6-712b9ecd9ab2</guid><dc:creator>Oskar Baginski</dc:creator><description>&lt;p&gt;I suppose that PPI module is solution. Thank you for help, Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 radio bit counter</title><link>https://devzone.nordicsemi.com/thread/78095?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 15:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cbed3b9-b6fa-42c0-b2f1-ba038531751d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Oskar&lt;/p&gt;
&lt;p&gt;The bit counter is intended to count bits within the packet, and not entire packets.
To count total packets you would be better of just updating a variable in the code (since you probably need to run some processing before/after each packet anyway), or set up a timer module in counter mode and have it count the END events through the PPI.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have any examples for the bit counter, no, but it is used internally by some of our stacks and libraries.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>