<?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>Protecting the battery via sleep mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84834/protecting-the-battery-via-sleep-mode</link><description>Hello, 
 I am trying to protect the battery on our application by putting my device in DEEP_SLEEP_! mode when a certain voltage is reached and waking it up upon a GPIO input. 
 In order to understand how it works i put together a very simple piece of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Feb 2022 14:07:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84834/protecting-the-battery-via-sleep-mode" /><item><title>RE: Protecting the battery via sleep mode</title><link>https://devzone.nordicsemi.com/thread/353643?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 14:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:134fd1a1-afdd-487b-b47f-488347b410e5</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have a look at this one:&amp;nbsp;&lt;/span&gt;&lt;a title="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/nrf/system_off" href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/nrf/system_off" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/nrf/system_off&lt;/a&gt;.&amp;nbsp;It should also work for nRF9160.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The sample is made to show how to enter the system OFF and how to wake up on a pin event. The modem also needs to be shut down to get the power consumption to go down.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For wake up, see &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/a4edab554f67590a89703067af703c7996604562/samples/boards/nrf/system_off/src/main.c#L61-64"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/a4edab554f67590a89703067af703c7996604562/samples/boards/nrf/system_off/src/main.c#L61-64&lt;/a&gt; :&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_gpio_cfg_input(DT_GPIO_PIN(DT_NODELABEL(button0), gpios), NRF_GPIO_PIN_PULLUP);
nrf_gpio_cfg_sense_set(DT_GPIO_PIN(DT_NODELABEL(button0), gpios), NRF_GPIO_PIN_SENSE_LOW);&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Note that it&amp;#39;s using the sense_set function.&amp;nbsp;GPIO wakeup from system OFF uses the GPIO SENSE event&amp;nbsp;while normally in system ON idle, gpio interrupt is generated by GPIOTE IN event, but that does not work in system OFF. T&lt;span&gt;he wakeup pin has to be configured with the correct settings. The&amp;nbsp;&lt;/span&gt;gpio_pin_interrupt_configure() you used&amp;nbsp;&lt;span&gt;will not work because that uses the GPIOTE IN event.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>