<?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>Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63744/reduce-power-consumption-on-nrf51822</link><description>Hi all, 
 I am using the nRF51822 and attach you can find the . . 
 I have noted that the current consumption is too hight for my scope (about 1.7mA). My idea is to &amp;#39;reduce&amp;#39; the code with only acquisition of 6 ADC and trasmission it via Bluetooth. I know</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Jul 2020 15:21:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63744/reduce-power-consumption-on-nrf51822" /><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259966?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 15:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2fce5c3-1b33-4903-9d80-1cf77719fc35</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;Yes, correct! Add those sources to your project and build them. Note that you should edit the nrf_drv_config.h first, to enable the RTC module (otherwise the part #if NRF_MODULE_ENABLED(RTC1) won&amp;#39;t compile).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259963?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 15:00:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08a55995-6f9b-4048-bedf-e081640456a4</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Attach you can foind the &amp;quot;.c&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1832.nrf_5F00_drv_5F00_rtc.c"&gt;devzone.nordicsemi.com/.../1832.nrf_5F00_drv_5F00_rtc.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259962?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 14:58:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d188a66-f945-4bf5-911a-53024ed61b40</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Thanks for you help. So I need to include the library (regarding the RTC) in my project. Correct? I put the file belew. How can I modify my sorce code?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_rtc.h"&gt;devzone.nordicsemi.com/.../nrf_5F00_drv_5F00_rtc.h&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_rtc.c"&gt;devzone.nordicsemi.com/.../nrf_5F00_drv_5F00_rtc.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259940?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 14:11:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4926991-15ee-4e12-bb79-b3f6c5fd0d20</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;And about your second question - no, my suggestion was to increase this value:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define APP_ADV_INTERVAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; The advertising interval (in units of 0.625 ms.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note that this number (1600) must be multiplied by 0.625 ms to get the number in seconds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259936?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 14:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f1d65f4-d09b-42bb-9751-83f4413d56a6</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;No, I mean software flag. This is what I do in my code:&lt;/p&gt;
&lt;p&gt;In my main loop I have:&lt;/p&gt;
&lt;p&gt;void main(void){&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Init code should be here:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/p&gt;
&lt;p&gt;&amp;nbsp; //Main loop is here:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; while(1){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(rtc_trigger){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rtc_trigger = 0;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Do stuff here. Init peripherals, bluetooth, send data, etc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Then uninit everything to save power. Everything except RTC.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__SEV();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__WFE();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__WFE();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In my RTC handler I have:&lt;/p&gt;
&lt;p&gt;void RTC1_IRQHandler(void){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(NRF_RTC1-&amp;gt;EVENTS_COMPARE[0]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_RTC1-&amp;gt;EVENTS_COMPARE[0] = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_RTC1-&amp;gt;TASKS_CLEAR = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtc_trigger = 1; //This is the software flag I was talking about&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;IMPORTANT: use non-softdevice API for the RTC, because once you invoke sd_softdevice_disable() everything related to it will stop working ... I suggest you use either direct register access or use the low-level drivers (examples are located in nRF5_SDK_xx.x.x_xxxxxx/examples/peripheral)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259884?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 11:20:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9734d1d5-8fb9-4669-902d-d368e26ba99a</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Sorry for the before answer. I think that your suggestion is to modify the following&lt;/p&gt;
&lt;p&gt;&lt;em&gt;#define APP_TIMER_PRESCALER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259882?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 11:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb46247b-82aa-4d94-a6e2-dc747c031ecc</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Great :-)&lt;/p&gt;
&lt;p&gt;So the best way is to insert a flag hardware. Correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259881?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 10:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25a00093-ed1e-4ff0-903a-f99677bc0e95</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;Actually the ADC should be off to save power. You should turn it on in the RTC handler, make your measurements, then turn on the bluetooth, send your data, then go back to sleep (call the code mentioned above). A better way is to just set a flag in the RTC handler and do all that stuff in the main loop.&lt;/p&gt;
&lt;p&gt;If you look at the nrf SDK examples, you will see that Nordic invoke WFE two times. This is due to the way the microprocessor works - the WFE instruction (that is placed inside the __WFE() intrinsic) will put the processor to sleep BUT there is an event latch (bit) and if it&amp;#39;s set to 1, it will be cleared and sleeping will be skipped. To ensure on 100% that the processor goes to sleep, call this function two times and it will enter sleep even if the event bit is set to 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259877?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 10:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a8427f8-adc0-492b-a601-9f64380c5c47</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Thank a lot for your correction of my code. &lt;/p&gt;
&lt;p&gt;When you write &amp;quot; &lt;em&gt;then you must put some logic in the RTC handler&lt;/em&gt;&amp;quot;what do you mean?&lt;/p&gt;
&lt;p&gt;Is not the ADC enough to switch on from the sleep the chip?&lt;/p&gt;
&lt;p&gt;Why do you write twice &amp;quot;__WFE()&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259874?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 10:26:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e68a547-509a-4776-b0e8-66f5519d1daf</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;More like:&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;sd_softdevice_disable();&lt;/p&gt;
&lt;p&gt;for (;;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __SEV();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__WFE();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__WFE();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;//And the RTC should wake up the system - then you must put some logic in the RTC handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259872?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 10:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac9035a9-41b3-40e2-bfe8-3cd002a7d6da</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;thank a lot for the answer. My scope is only to acquire the 6 ADC channel and send the data via bluetooth but I don&amp;#39;t need to send data continuously&lt;/p&gt;
&lt;p&gt;So you suggest to write as follow:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;for (;;)
    {
        __SEV();
		__WFE();
		__WFE();
		sd_softdevice_disable()
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Correct?&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;
&lt;p&gt;Angelo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reduce power consumption on nRF51822</title><link>https://devzone.nordicsemi.com/thread/259871?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 10:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd5f73e3-0815-4a80-9142-98090bee9df8</guid><dc:creator>L.B.</dc:creator><description>&lt;p&gt;If you need to send data continuously, then I believe that increasing the advertising interval is a good way to do it.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been developing firmware for the same chip, and was able to use the RTC to periodically wake up the system and sleep during the rest of the time, then the consumption is greatly reduced (4 uA). But you must leave only the RTC to be on, everything else should be off. I use sd_softdevice_disable()&amp;nbsp; instead of sd_system_power_off() and also&lt;/p&gt;
&lt;p&gt;while(1){&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;__SEV();&lt;br /&gt;__WFE();&lt;br /&gt;__WFE();&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;L. B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>