<?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>nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111667/nrf52840-power-consumption-with-sleep-off-mode-and-sleep-on-mode</link><description>We are nRF52840 in one of our products. When we use SYSTEM OFF mode with with hardware design, current consumption is around 3uA but when we use SYSTEM ON mode with RAM retention current increases to 17uA. But according to datasheet of nRF52840, current</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Jun 2024 07:13:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111667/nrf52840-power-consumption-with-sleep-off-mode-and-sleep-on-mode" /><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/488994?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 07:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb06875-74d1-4841-8c7d-0dc31ea64440</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, can you try to enable interrupts, but disable the callbacks so that we can narrow this down to either being the interrupt itself or the post-processing from the interrupt callback that is drawing this power. We think this could be due to the edge detection on the GPIOs as that does draw a bit more power, but it could also be post-processing we think.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/488556?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 18:54:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dd71e5d-b35e-472c-a4a4-b11825a729d9</guid><dc:creator>BilalAliAhmad</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On further investigation, I found that GPIO interrupts are taking current, if I disable GPIO interrupts, current consumption comes down to 4uA from 17uA. We have four button in our design and I am configuring GPIO interrupt through this code. Can you please check is the issue with this code when I enable GPIO interrupt through this code current increases from 4uA to 17uA:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/gpio.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;

#define BUTTON0_PORT_NODE DT_NODELABEL(gpio0)
#define BUTTON1_PORT_NODE DT_NODELABEL(gpio0)
#define BUTTON2_PORT_NODE DT_NODELABEL(gpio1)
#define BUTTON3_PORT_NODE DT_NODELABEL(gpio1)

static struct gpio_callback button_cb_data[2]; // Two callbacks, one for each port
static const struct gpio_dt_spec buttons[] = {
    GPIO_DT_SPEC_GET_OR(DT_ALIAS(button0), gpios, {0}),
    GPIO_DT_SPEC_GET_OR(DT_ALIAS(button1), gpios, {0}),
    GPIO_DT_SPEC_GET_OR(DT_ALIAS(button2), gpios, {0}),
    GPIO_DT_SPEC_GET_OR(DT_ALIAS(button3), gpios, {0}),
};

void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
    for (int i = 0; i &amp;lt; ARRAY_SIZE(buttons); i++) {
        if ((buttons[i].port == dev) &amp;amp;&amp;amp; (pins &amp;amp; BIT(buttons[i].pin))) {
            printk(&amp;quot;Button %d pressed\n&amp;quot;, i);
        }
    }
}

void main(void)
{
    const struct device *port0;
    const struct device *port1;
    int ret;

    port0 = device_get_binding(DT_LABEL(BUTTON0_PORT_NODE));
    if (!port0) {
        printk(&amp;quot;Error: Port0 device not found.\n&amp;quot;);
        return;
    }

    port1 = device_get_binding(DT_LABEL(BUTTON2_PORT_NODE));
    if (!port1) {
        printk(&amp;quot;Error: Port1 device not found.\n&amp;quot;);
        return;
    }

    for (int i = 0; i &amp;lt; ARRAY_SIZE(buttons); i++) {
        const struct device *port = buttons[i].port;
        
        if (!device_is_ready(port)) {
            printk(&amp;quot;Error: Button %d device not ready.\n&amp;quot;, i);
            return;
        }

        ret = gpio_pin_configure(port, buttons[i].pin, GPIO_INPUT | GPIO_PULL_UP);
        if (ret != 0) {
            printk(&amp;quot;Error %d: failed to configure button %d pin\n&amp;quot;, ret, i);
            return;
        }

        ret = gpio_pin_interrupt_configure(port, buttons[i].pin, GPIO_INT_EDGE_TO_ACTIVE);
        if (ret != 0) {
            printk(&amp;quot;Error %d: failed to configure button %d interrupt\n&amp;quot;, ret, i);
            return;
        }
    }

    gpio_init_callback(&amp;amp;button_cb_data[0], button_pressed, BIT(buttons[0].pin) | BIT(buttons[1].pin));
    gpio_add_callback(port0, &amp;amp;button_cb_data[0]);

    gpio_init_callback(&amp;amp;button_cb_data[1], button_pressed, BIT(buttons[2].pin) | BIT(buttons[3].pin));
    gpio_add_callback(port1, &amp;amp;button_cb_data[1]);

    printk(&amp;quot;Press the buttons\n&amp;quot;);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/488381?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 19:41:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4b59204-2a21-45c0-ab8a-95776478e1af</guid><dc:creator>BilalAliAhmad</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how can we disable or not retain RAM blocks if they are not being uses during idle mode?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/486804?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 07:48:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:411b6084-b2f7-447e-a0b1-956d6bb4e850</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, can you upload the .ppk plot as an attachment here (in a .zip file) so I can review the current consumption plot. That could give us a pointer to what is drawing power. Is something that might draw power connected to the nRF52840, like a sensor or something. If it is powered by the nRF52, then the lower consumption when the nRF52 is turned off would make sense. But it could also just be the amount of RAM blocks being retained that draws this current.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/486726?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 15:59:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33d41141-4bb7-45e8-aada-c1e3daab17de</guid><dc:creator>BilalAliAhmad</dc:creator><description>&lt;p&gt;Current consumption is 17uA with system ON mode and 3.5uA with System OFF mode. If there is a leakage current in the circuit why it drops to 3.5uA in system off mode? We are using power profiler kit to measure current consumption.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Power consumption with SLEEP OFF mode and SLEEP ON mode</title><link>https://devzone.nordicsemi.com/thread/486627?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 10:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0000ad81-4953-45e6-a39f-6c386216c3f1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Please specify what you mean here, because RAM retention is used by default in System ON mode, so do you mean system OFF here is drawing 17uA? If so, I assume there is some leakage current somewhere in your circuit. Do you also see this current consumption when measuring current consumption on a DK? And how exactly are you measuring current consumption here?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>