<?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>Waking the nRF52840 from SYSTEMOFF - Arduino Nano 33 board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58631/waking-the-nrf52840-from-systemoff---arduino-nano-33-board</link><description>Hi, 
 I am fully aware that this is not an Arduino forum and that is not the responsibility of the users here to answer Arduino related questions - I have tried looking on the Arduino forums for answers but they basically send me to this forum as the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Mar 2020 14:40:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58631/waking-the-nrf52840-from-systemoff---arduino-nano-33-board" /><item><title>RE: Waking the nRF52840 from SYSTEMOFF - Arduino Nano 33 board</title><link>https://devzone.nordicsemi.com/thread/238076?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce093426-d0b1-45ec-a1f8-3f0c5c24c78e</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you seen that Arduino has their own BLE library? This may be an easier way to start for you if you are already familiar with the Arduino enviroment than writing to the registers directly...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe they have included some power management options in their BLE library? Take a look at &lt;a href="https://www.arduino.cc/en/Reference/ArduinoBLE"&gt;https://www.arduino.cc/en/Reference/ArduinoBLE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If not using the Arduino library, I recommend using our nRF5 SDK and looking at the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/pwr_mgmt_example.html"&gt;Power Management Example&lt;/a&gt;, which is located under \examples\peripheral\pwr_mgmt in the SDK install folder.&lt;/p&gt;
&lt;p&gt;There are two options for achieving low energy. They are SYSTEM OFF mode and SYSTEM ON IDLE mode. You should choose based on how long it will take until your next wake up.&lt;/p&gt;
&lt;p&gt;When using SYSTEM OFF the device will start in reset state, so you will need to run the start up code again which will draw some current. If you haven&amp;#39;t plan to sleep for long then it may not pay off to use SYSTEM OFF. &lt;/p&gt;
&lt;p&gt;For SYSTEM ON idle only the CPU goes to sleep, in WFE (wait for event) state.&amp;nbsp; You can wake up from system ON idle with any internal or external event, the RTC is typically used for this.&lt;/p&gt;
&lt;p&gt;From SYSTEM OFF you need an external wake up source, which could be a button press, a sense signal from NFC, or you can sample an analog value with the comparator and wake up after passing a certain threshold. &lt;/p&gt;
&lt;p&gt;If you enable the sense mechanism of any GPIO pin (&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_0#concept_o12_bgv_bs"&gt;SENSE bit in PIN_CNF[n] register&lt;/a&gt;), a DETECT signal will be generated if the correct sense is detected. Using our nRF5 SDK you can configure the sense field of a pin using function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_gpio_cfg_sense_set(uint32_t pin_number, nrf_gpio_pin_sense_t sense_config)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;About the reset button: the external button is connected to P0.18 RESETN so I recommend using another pin as GPIO for a wake up button. I am not sure why your program gets erased pressing the reset button twice, could it be that it sets the arduino board in bootloader mode?&amp;nbsp;What happens if you press the reset button again? See this thread in the Arduino forums: &lt;a href="https://forum.arduino.cc/index.php?topic=630864.0"&gt;https://forum.arduino.cc/index.php?topic=630864.0&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you are planning to make a possible commercial product I will recommend bypassing the Arduino enviroment and using our nRF5 SDK directly instead.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>