<?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 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89229/nrf51822-current-consumption-during-ble-advertising</link><description>Hello, guys. 
 We are using nRF51822 SoC in our project. I would really appreciate your help with the expected current consumption in BLE advertising mode. Here is what we record with the Power Profile Kit II (BLE advertising interval is set to ~300ms</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Jun 2022 08:29:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89229/nrf51822-current-consumption-during-ble-advertising" /><item><title>RE: nRF51822 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/thread/374071?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 08:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e600fa85-e4ae-48a2-b36c-76c733012343</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The main reason for increased power consumption was the &lt;span style="background-color:#ff99cc;"&gt;&lt;strong&gt;GPIOTE&lt;/strong&gt; &lt;/span&gt;peripheral that was configured to use a high-frequency clock (HFCLK):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When it is initialized with a &lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;&lt;strong&gt;false&lt;/strong&gt; &lt;/em&gt;&lt;/span&gt;parameter (low accuracy), a low-frequency clock is used and, consequently, current consumption is significantly reduced. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50624/about-current-consumption-of-gpio-and-gpiote" rel="noopener noreferrer" target="_blank"&gt;This thread&lt;/a&gt; contains a pretty good explanation about that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/thread/373883?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 09:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d982e73-3bee-4d0d-af20-440c21cdf627</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hey, &lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;It seems that the increased current consumption comes from the GPIOs! I used the &lt;strong&gt;&lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;nrf_gpio_cfg_default()&lt;/em&gt;&lt;/span&gt; &lt;/strong&gt;function to set all GPIOs to the default state (disconnected inputs) before BLE advertising and here is what I get:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1655976005020v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Current consumption between two BLE advertising cycles goes down to &lt;span style="background-color:#ccffcc;"&gt;&lt;strong&gt;~100uA&lt;/strong&gt;&lt;/span&gt; order of magnitude!&lt;/p&gt;
&lt;p&gt;It is now clear to me that it is quite important to properly handle GPIOs if we want to optimize the current consumption.&lt;/p&gt;
&lt;p&gt;Thanks once again for guiding me in the right direction.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/thread/373856?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 08:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec36b4e3-d2b4-420f-9d79-d6efad33feab</guid><dc:creator>Edvin</dc:creator><description>[quote user="bojan"]We have a few nRF51 GPIOs that are floating. Perhaps the current is leaking through them if they are not properly configured? Do we need to explicitly configure them as inputs with pull-up or pull-down resistors enabled?[/quote]
&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes. If you want to consume the minimum amount of power, you should reset the GPIOs that you have used. I am not sure where/how you configured them, but if that was through a peripheral, then you can try to use the &amp;quot;uninit&amp;quot; equivalent of the init function. Not all of these uninit/deinit functions do this properly, so check that the pin is correctly set back to the default state after you are done.&lt;/p&gt;
&lt;p&gt;You can check the register for the GPIO&amp;#39;s PIN_CNF[n]. Please check the &lt;a href="https://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.1.pdf?cp=5_2_0"&gt;Reference Manual&lt;/a&gt;, Table 83 on page 68.&lt;/p&gt;
&lt;p&gt;A default pin configuration should be 0x00000002, which is the default (reset) value. This state is called &amp;quot;disconnected input&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can also read the register from your application using:&lt;/p&gt;
&lt;p&gt;unit32_t config = NRF_GPIO-&amp;gt;PIN_CNF[0]; //this will read the pin configuration of P0.00.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, you can read it out using a debugger and nrfjprog --memrd 0x50000700&amp;quot; to read P0.00. for pin N use the address: 0x50000700 + n*0x04&lt;/p&gt;
&lt;p&gt;Or, depending on what IDE you are using, you can probably set a breakpoint and monitor the peripheral registers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/thread/373842?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 07:47:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac9ff6a8-fb95-4bb5-8f53-4ecf63a6d47e</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Thanks for your feedback.&lt;/p&gt;
&lt;p&gt;I have disabled debugging and both UART and RTT backends in &lt;span style="background-color:#ccffcc;"&gt;sdk_config.h&lt;/span&gt; file (find it attached), power cycled the board after downloading the code, as you suggested, but the current consumption waveform is still the same. The board consumes &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;strong&gt;~1.6mA&lt;/strong&gt;&lt;/span&gt; of current between two BLE advertising cycles.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/89229/nrf51822-current-consumption-during-ble-advertising/373665"]Are you measuring the current consumption on a DK or a custom board? If you are using a DK, did you cut the solderbridge SB9?[/quote]
&lt;p&gt;I&amp;#39;m measuring current consumption on our custom-designed board and we have an external 1K pull-down resistor connected to the &lt;span style="background-color:#ccffcc;"&gt;&lt;strong&gt;SWDCLK&lt;/strong&gt; &lt;/span&gt;pin, as you suggested.&lt;/p&gt;
&lt;p&gt;As I already mentioned, when I put all the peripheral chips on the board in shutdown mode and nRF51 in System OFF mode, the measured current consumption is about &lt;strong&gt;~100uA&lt;/strong&gt;. When all the peripherals remain in the same shutdown mode but nRF51 is continuously advertising, current consumption between two BLE advertising cycles rises to &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;strong&gt;~1.6mA&lt;/strong&gt;&lt;/span&gt;.&amp;nbsp; CPU usage between two BLE advertising cycles is &lt;strong&gt;0%&lt;/strong&gt;. I&amp;#39;ve confirmed this by enabling appropriate debug logs from &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Flib_pwr_mgmt.html" rel="noopener noreferrer" target="_blank"&gt;Power Management Library&lt;/a&gt;. So what we have is that the board consumes &lt;span style="background-color:#ccffcc;"&gt;&lt;strong&gt;~100uA&lt;/strong&gt;&lt;/span&gt; when nRF51 is in System OFF and &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;strong&gt;~1.6mA&lt;/strong&gt;&lt;/span&gt; when nRF51 is in System ON sleep mode.&lt;/p&gt;
&lt;p&gt;We have a few nRF51 GPIOs that are floating. Perhaps the current is leaking through them if they are not properly configured? Do we need to explicitly configure them as inputs with pull-up or pull-down resistors enabled?&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4885.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../4885.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 current consumption during BLE advertising</title><link>https://devzone.nordicsemi.com/thread/373665?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 11:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63fd76f3-d8f5-4681-afae-a08a9ab73ec4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Bojan,&lt;/p&gt;
[quote user=""]The average current consumption between two BLE advertising cycles is &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;strong&gt;~1.6mA&lt;/strong&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Are you in a debug session? Or have you been? Try stopping the debug session, then power cycle the nRF51 and do the measurement again. Does that lower the idle current consumption?&lt;/p&gt;
&lt;p&gt;Actually, on the topic, there were some issues with the nRF51 going into debug mode from time to time (without a debugger attached), so in the reference design we recommend adding an external 1k pulldown resistor on the SWDCLK pin. This is already mentioned in the reference designs:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1655898064050v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Are you measuring the current consumption on a DK or a custom board? If you are using a DK, did you cut the solderbridge SB9?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Is my understanding correct?[/quote]
&lt;p&gt;Yes. That seems about correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In case you haven&amp;#39;t stumbled upon this, I find the Online Power Profiler quite useful for simulating the current consumption based on advertising/connection interval and the HW setup you are using. Check it out:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/power/w/opp/2/online-power-profiler-for-bluetooth-le"&gt;https://devzone.nordicsemi.com/power/w/opp/2/online-power-profiler-for-bluetooth-le&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I see now that it is only supported for the nRF52 series and nRF53 series, but perhaps it can still give some idea in how intervals and DCDC affects the average current consumption.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>