<?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>NRF51822 Audio Application &amp;amp; Compression</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3059/nrf51822-audio-application-compression</link><description>Hello, 
 I am working on an application that involves sampling audio data ~8KHz. I have a few questions 
 
 
 The real time clock module has a maximum interrupt frequency of 32768/5 = 6554 Hz. Is there another mechanism to achieve a slightly greater</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Jul 2014 09:29:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3059/nrf51822-audio-application-compression" /><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11453?ContentTypeID=1</link><pubDate>Thu, 24 Jul 2014 09:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cd91ccd-1699-43bd-8df3-5ee035e324e0</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;If you however use the softdevice things are done pretty much automatically for you. When you enable the softdevice you specify which low frequency clock source you want to use. The softdevice also automatically enables the external high frequency crystal when the radio is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11452?ContentTypeID=1</link><pubDate>Thu, 24 Jul 2014 09:25:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b652f36-dd82-4073-9b07-db9ef7274855</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;There are two clock sources in the system, low frequency 32kHz clock and high frequency 16MHz clock. You can see in table 28 in the nRF51822 PS v2.0 what clock source each peripheral requires. For both high and low frequency clocks you can select either internal RC oscillator or external crystal. High frequency external crystal is mandatory for any radio communication, Low frequency external crystal is optional but is the best choise for low power application. You have to enable the low frequency clock explicitly and specify if you wish to use internal RC or external crystal as the low frequency clock source. If you do not explicitly enable a high frequency clock, the internal RC is automatically enabled when any peripherals require a 16MHz clock, and it is disabled again when no peripheral require it. You must however explicitly enable the 16MHz external crystal clock source&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11451?ContentTypeID=1</link><pubDate>Wed, 23 Jul 2014 14:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6862a554-6e1d-413f-836c-c460805c4530</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Stefan,&lt;/p&gt;
&lt;p&gt;One last clarification. Does the nrf51822 manage clock selection for the user? If the radio is being used it will use the 16MHZ X0SC? Otherwise it will use RC? Enabling and disabling of clocks in not left up to the user it is handled demand based by the nrf51822?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11450?ContentTypeID=1</link><pubDate>Wed, 23 Jul 2014 07:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ff275d5-8205-4933-8d36-ca9c99d8c3d7</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;You can see the current consumption of a TIMER peripheral in the nRF51822_PS v2.0, sections 8.13, which is 30uA. However, the TIMER needs 1.2V regulator and 16MHz clock source (either RC or external crystal (XOSC)) and that will consume extra 880uA or 810uA respectively, see table 27.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11449?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2014 15:43:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf46a69-34b3-43d7-ac3d-88d0aab59537</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Stefan,
Thank you for the information. This will be extremely useful moving forward. Where is it documented how much power each peripheral uses when active?
Lucas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11448?ContentTypeID=1</link><pubDate>Mon, 21 Jul 2014 09:06:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:387badfa-47cf-4f57-add2-30e3b5facfe8</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Thank you for pointing out the exact code that limits the frequency to 32768/5 Hz. I actually did not realize that. I guess it has to do with the RTC delay/jitter specification described in sections 18.1.8 and 18.1.9 in the nRF51 Series Reference Manual and the way the application timer is implemented. I did not realize you were using the application timers actually. For higher frequency you could of cource use a TIMER peripheral instead but that will cost you up to ~1mA of extra current consumption.&lt;/p&gt;
&lt;p&gt;The thing that decides the CPU blocking time is how many packets you send in a BLE connection event and how many payload bytes are present in each packet. Shortest blocking time is when no payload is sent from peripheral or central. Longest blocking time is for maximum throughput in both directions, i.e. 6 packets sending and receiving, each with 20 bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11447?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2014 18:37:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76fb92d6-f84d-433e-8239-52926a9f775a</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Stefan,&lt;/p&gt;
&lt;p&gt;I am interested in finding out more about this proposed solution
&lt;a href="https://devzone.nordicsemi.com/question/1771/adc-softdevice-sample-rate-on-nrf51822/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See the last comment in the above thread apparently left by you. Would this really work? Has it been tested do you have code examples for the proposed functions that are necessary to get it working. I think this is my best option moving forward. I think this code would be helpful to the community as a whole. Additionally, I wouldn&amp;#39;t mind handing over some of my embedded compression stuff to nordic if other customers are interested in audio application. I&amp;#39;ve made some improvements &amp;amp; 4x compression is possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11446?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2014 14:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ba54fb0-288b-4e2b-8a52-9f826dbf81b6</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Also,&lt;/p&gt;
&lt;p&gt;What decides the 1-6. The number of packets in the TX buffer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11445?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2014 14:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35c53331-bd3c-4eec-81e6-57a65cb27022</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;Stefan,&lt;/p&gt;
&lt;p&gt;For the reasons you mention my interrupt handler is&lt;/p&gt;
&lt;p&gt;nrf_adc-&amp;gt;events_end = 0;
nrf_adc-&amp;gt;events_end = 0;&lt;/p&gt;
&lt;p&gt;That is the only thing in the the handler.&lt;/p&gt;
&lt;p&gt;Also, it does appear that the frequency is limited to 32768/5 Hz. Nordic developers have done a good job to include error codes in their api, and the limit was not hard to identify.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if ((timer_id &amp;gt;= m_node_array_size) || (timeout_ticks &amp;lt; APP_TIMER_MIN_TIMEOUT_TICKS))
{
    return NRF_ERROR_INVALID_PARAM;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;#define APP_TIMER_MIN_TIMEOUT_TICKS  5&lt;/p&gt;
&lt;p&gt;The CPU blocking does though a bit of a wrench into my plans. However, sampling at 8KHz and being block for 1ms-6ms every 30ms (Our minimum connection interval) may produce sufficient quality audio . I will not know until I try entire system. However, what is the best solution to the RTC. Can I use the timer/counter?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11444?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2014 11:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b322614-7ae0-4909-a17e-88e6c96ea648</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Lucas&lt;/p&gt;
&lt;p&gt;Is the RTC interrupt handler limited to 32768/5 Hz? I haven&amp;#39;t heard of that before. The interrupt handler is executed perhaps 3-5 microseconds after the RTC event is triggered and will perhaps take a few microseconds to execute, given your code in the handler is relatively short, so there should be plenty of CPU time available for the RTC interrupt handler to execute with 8kHz frequency or even up to 32kHz frequency.&lt;/p&gt;
&lt;p&gt;Is perhaps something else in your code that is using CPU time, thereby limiting the CPU time left for the RTC interrupt handler. Is your code execution in the RTC interrupt handler perhaps taking a long time to execute, thereby limiting the sampling frequency. Also, if you have softdevice enabled it will limit your sampling rate since the CPU is blocked for 1ms-6ms during a BLE radio event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Audio Application &amp; Compression</title><link>https://devzone.nordicsemi.com/thread/11443?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2014 21:17:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7dd0341-68f4-4ce4-a557-d7ceb5c31d60</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;removed from post&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>