<?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>Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35422/trying-to-reduce-power-consumption</link><description>I have a small project on a custom board using an nRF51824 processor. 
 The code basically initializes the BLE stack timer and GPIO and then falls into a loop 
 while (true) sd_app_evt_wait(); 
 The timer (using RTC) fires every 5 seconds to kick the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jun 2018 22:01:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35422/trying-to-reduce-power-consumption" /><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136626?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 22:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c13449c9-e2c3-45f7-96f2-ac225cff3ba0</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;It&amp;#39;s been decided that we are done with this for now. Less than 1mA is good enough for the moment.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136545?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 12:13:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4312f47-c4fa-447a-8fe2-454a3cc27d8a</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;OK. I think you are correct - I have two separate boards sitting on my lab bench, and both behave identically. Hopefully the hardware guy can find the issue&amp;nbsp;elsewhere on the board.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136543?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 12:07:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c616577-7521-4e0c-b5fc-41572f334bde</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There is unfortunately no way to determine if the processor is in debug mode. It is highly unlikely that noise should make it enter debug mode every time you test, and particularly not when you have the 1k pull-down, so I do not think it is a likely explanation in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136535?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 11:32:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0aa298e5-6b8a-4e5e-bc2b-ca673282b6fb</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;That&amp;#39;s what I would have guessed as well. If I have time I may migrate to 12.3.0 in any case, so that any future issues will not have the possibility of being related to an old SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And now another question.&lt;/p&gt;
&lt;p&gt;Is it possible, programmatically, to determine if the processor is in debug mode, and (even better) turn off debug mode if it is? I don&amp;#39;t care if I have to set a register and restart the processor.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My engineer says that the 1K pulldown is there, but it would be good to confirm that the processor is indeed not in debug mode. Especially since he is convinced that nothing else on the board should be causing the power draw.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136529?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 11:15:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:319e0797-fab8-4122-9568-cae05b76ed9f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You are right that moving to a later SDK will not help with your power consumption. In general, there are bug fixes in all new SDK releases and errata fixes in most, but it may not be relevant for your project depending on what you are doing. In general, I always recommend customers to start developing with the latest SDK, but that doesn&amp;#39;t mean that it necessarily makes sense to migrate an older project to a new SDK. It all depends, really.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136525?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 10:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42f4e621-73f8-4bc8-a10e-b6c01c7243e6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I would say that this strongly indicate that there is a hardware issue. You (or rather the HW guy) can verify by isolating either the VDD or VSS pins from the PCB, and connecting them via an ampere meter (or resistor you measure voltage drop over). This way you can compare the current consumption of the whole PCB with the current consumption of only the nRF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136523?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 10:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b22c63c-7d74-4dab-8c2e-499ba1523fe9</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;Also, FWIW, I tried your second code snippet:&lt;/p&gt;
&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ble_stack_init();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;while (true)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;__WFI();&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;And my power consumption went from 0.84mA to 0.90mA.&lt;/p&gt;
&lt;p&gt;And now another question. I was given this code using the 10.0.0 SDK and in the spirit of not changing too many things at one have continued using it. It seems to work fine for what I need to do (advertise, connect, send a few bytes back and forth) but I&amp;#39;m happy to change to 12.3.0 if there is a good reason. Better BLE handling, errata handled, etc.&lt;br /&gt;&lt;br /&gt;I know it&amp;#39;s not going to help my power issue, but it may help my application.&lt;/p&gt;
&lt;p&gt;Thoughts?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136520?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 10:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1c9ed6-a0c8-4d93-9e3f-0eec42b2df82</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I implemented the following:&lt;/p&gt;
&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp;NRF_POWER-&amp;gt;SYSTEMOFF = 1;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;while (true)&lt;br /&gt;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; __WFI();&lt;br /&gt;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;And I&amp;#39;m pulling 0.84 mA&lt;/p&gt;
&lt;p&gt;The hardware engineer checked and the 1K resistor is on the SWDCLK line. There is no debugger attached, as I program the code and then move the device from the debugger socket.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will let him know definitively that there are other things on the board that are drawing power.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help. I&amp;#39;m going to leave this open until the hardware engineer either changes the hardware or tells me that he won&amp;#39;t be doing so.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136509?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 09:27:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0e78006-0cb8-4457-900e-c997b10b6b02</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can find the examples from the&amp;nbsp;nRF51 series current consumption guide&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrf51-powerdown-examples"&gt;here&lt;/a&gt;. The SDK has evolved significantly (SDK 12.3 is the latest release for nRF51), so they may not work out of the box unless you use SDK 11 for the test. You can also use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/ble_sdk_app_pwr_mgmt.html?cp=4_0_6_4_2_2_15"&gt;Power Profiling Application example&lt;/a&gt;&amp;nbsp;from to test current consumption in most scenarios (BLE advertising with system ON sleep mode between BLE events, BLE connection with system ON sleep mode between events and system OFF).&lt;/p&gt;
&lt;p&gt;You can make very simple firmware examples to test the basic low power modes. This simple main function will go immediately to system OFF low power mode. If you see a current consumption larger than a few micro amps, this comes from either 1) other components on your BPS, or 2) the nRF51 is in debug mode.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    // Enter system off low power mode mode.
    NRF_POWER-&amp;gt;SYSTEMOFF = 1;

    while (true)
    {
        // Should never arrive here
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can make a similar system ON example by taking a BLE example, and only initialize the SoftDevice before you go to sleep (see code snippet below). Initializing the SoftDevice will start the LFCLK and RTC0, which is the only resources you need enabled during sleep for a simple BLE application. It would look something like this (SDK 12.3). The nRF will stay in system ON low power mode indefinitely if a 32 kHz crystal is used. If not, it will wake up regularly to calibrate the 32 kHz RC oscillator (depending on the configuration when you initialized the SoftDevice).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    // Call ble_stack_init implemented in the main.c file of a BLE peripheral examples
    ble_stack_init();
    
    // Enter main loop.
    for (;;)
    {
        power_manage(); // System ON low power mode.
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136507?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 09:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df198fbd-9f46-4590-bf6a-ccf43c1a2843</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;It is probably &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/11/why-does-my-nrf51822-consume-1-ma-in-sleep"&gt;this question&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136446?ContentTypeID=1</link><pubDate>Sun, 17 Jun 2018 11:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:775c7c5f-59e2-4589-8124-c8b082bbcd9c</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;Hey.&lt;/p&gt;
&lt;p&gt;Clearly there is something I&amp;#39;m not doing or there&amp;#39;s a hardware issue.&lt;/p&gt;
&lt;p&gt;I reduced my program to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;main (void)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;while (1) __WFI();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;and it still draws 0.85 mA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With all my code running, just about 0.90 mA.&lt;/p&gt;
&lt;p&gt;Thoughts?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136394?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 14:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6825092-14d6-48d9-8c62-f7b67de6d825</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;Also, there are a bunch of references to &amp;quot;&lt;a href="https://devzone.nordicsemi.com/index.php/why-does-my-nrf51822-consume-1-ma-in-sleep" rel="nofollow noopener noreferrer" target="_blank"&gt;https://devzone.nordicsemi.com/index.php/why-does-my-nrf51822-consume-1-ma-in-sleep&lt;/a&gt;&amp;quot; but that link is dead too... Do you have a current link for that?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136392?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 13:56:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3661333-acbf-4849-8d8a-ebf6409177fe</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;I will ask the HW engineer about the resistor.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;There is no debugger attached to the device - I&amp;#39;m using DFU to update code and power cycling the device afterwards. Is there a way for software to tell if the device is in debug mode and take it out of debug mode?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136390?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 13:41:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34b16b4b-e609-4aab-8488-e14078d6a488</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;The link you provided has links to &amp;quot;system on mode example&amp;quot; and &amp;quot;system off mode example&amp;quot;. But they are dead links. Can you point me at a good link for these. Or the example in the 10.0.0.0 SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136382?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 13:26:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:859ecc70-92e2-41db-b1d9-5efaea512d28</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Rob,&lt;/p&gt;
&lt;p&gt;Sounds good.&lt;/p&gt;
&lt;p&gt;Just a few more comments on the debug mode. The nRF51 can enter debug mode if there is noise on the SWD CLK pad, as the internal pull-down is quite weak. Do you have the recommended external 1k pull-down on the SWDCLK board from the reference layout? If not, noise picked up on the SWDCLK line could put the device in debug mode even if no debugger is connected. This is particularly the case if you have long SWDCLK lines. A last point is that you need to power cycle the board after disconnecting the debugger in order to make sure the device is not in debug mode.&lt;/p&gt;
&lt;p&gt;Another point is that you should verify whether the current consumption is actually caused by the nRF or by some other devices on the board. (LED&amp;#39;s, other IC&amp;#39;s, pull resistors etc.).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136369?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 12:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf48f8cb-4e7e-4f19-8d07-256632b7e5e6</guid><dc:creator>Rob Philip</dc:creator><description>&lt;p&gt;No debugger attached. I&amp;quot;ll dig into the current consumption guide.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to reduce power consumption</title><link>https://devzone.nordicsemi.com/thread/136260?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 06:15:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5821b80-0503-4dcc-927f-857ac6bd4ce8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The device should not consume this much with the code&amp;nbsp;you describe. You may have the chip in debug mode, as the nRF51 consumes about 1 mA when debug mode is enabled. Do you have a debugger connected to the device when you do current measurements? If so, try disconnecting it before you do current measurements. Does current consumption come down when you do?&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://devzone.nordicsemi.com/tutorials/b/hardware-and-layout/posts/nrf51-current-consumption-guide"&gt;nRF51 series current consumption guide&lt;/a&gt; has a good overview of what you should do to reduce current consumption of your nRF51 device.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>