<?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>how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41198/how-to-wake-up-from-sleep-mode</link><description>hi..... 
 i am using nrf52832 ........ 
 i want to wake up my device from sleep mode ... i have used the command for sleep mode sd_app_evt_wait() ...... i dono what command to give for waking up device from sleep mode 
 thanks in advance 
 suggest me</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Dec 2018 08:06:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41198/how-to-wake-up-from-sleep-mode" /><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160878?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 08:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89659f7d-5f22-4121-b5a0-14deb803c659</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Please refer to the &lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_timer"&gt;documentation&lt;/a&gt; or &lt;a href="https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/application-timer-tutorial"&gt;tutorial&lt;/a&gt;. There are also a number of SDK examples that use the app timer, for instance &amp;lt;SDK&amp;gt;\examples\peripheral\csense_drv\main.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160826?ContentTypeID=1</link><pubDate>Sat, 08 Dec 2018 10:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bec1492-ca03-4cc5-811f-59d50ffa7fd3</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;where i should set the timer ? how to make it run continuously ?&lt;/p&gt;
&lt;p&gt;is this right ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uint32_t time_ms = 2000;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160714?ContentTypeID=1</link><pubDate>Fri, 07 Dec 2018 11:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30ab8474-ee7e-4c9a-94d7-916f403038c2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;A few posts were deleted by a mistake, but here are the answers:&lt;/p&gt;
&lt;p&gt;1. The best and simplest way to verify that the device is in sleep is to measure current consumption (that is what you are after in the end anyway).&lt;/p&gt;
&lt;p&gt;2. The nRF has to wake up to read the sensor. It cannot do that while it is sleeping. That is why I suggest you wake up to read the sensor using a app_timer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160704?ContentTypeID=1</link><pubDate>Fri, 07 Dec 2018 10:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58cdd8ed-3ff5-4941-b619-5353f857510c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, measuring current consumption is the simplest and best way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160660?ContentTypeID=1</link><pubDate>Fri, 07 Dec 2018 05:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9620ea79-0d40-45ae-a723-69fb77c8328a</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;ok ... how you know that device in sleep mode ?&lt;/p&gt;
&lt;p&gt;by measuring current or checking data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160592?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 14:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64bb3f89-c281-44cc-9768-7f10be69b3f8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I suggest you use the app_timer (&lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_timer"&gt;timer library&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160559?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 12:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2816920c-3589-4128-964e-3541f4bdbd63</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;how to wake up the nrf&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160557?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 11:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dc0f692-d0c9-40c1-bf62-1feeea5d23cc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Looking at your code snippets I see there are a number of misunderstandings here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have to read data via TWI to see if the temperature has crossed the threshold. So clearly the nRF cannot wake on that event, as the only way it can know about it is to wake up regularly and read the sensor.&lt;/li&gt;
&lt;li&gt;You do a busy wait in your main loop, which waits by spending CPU cycles. This means that your application will spend 5 seconds consuming a lot of power while doing nothing for every iteration of your main loop.&lt;/li&gt;
&lt;li&gt;The&amp;nbsp;sd_app_evt_wait() call should cause the CPU to sleep for a bit of time, but only until the TWI transaction has finished. All the rest of your waiting happens in the busy wait (sd_app_evt_wait()).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The proper way to do what you want is to have a main loop which does close to nothing other than calling&amp;nbsp;sd_app_evt_wait(). Then you should use a low power timer (RTC), typically via the timer library to read the sensor at a regular interval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160555?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 11:28:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c7e910-57ac-4b75-bf4d-c75fcd65009f</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;&amp;nbsp;not using pin interrupt ... when my temperature goes beyond threshold it should wake up automatically&amp;nbsp;&lt;/p&gt;
&lt;p&gt;see the code here i didn&amp;#39;t use sleep mode&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void threshold_value()

{
   
      m_xfer_done = false;
    uint16_t length1;
    uint16_t threshold;
 
    char str[80];
     threshold= 30;
 if (m_sample &amp;lt; threshold )

    {      
 
    length1 = sprintf(str,&amp;quot;%d&amp;quot;, m_sample);
  nrf_drv_twi_rx(&amp;amp;m_twi, LM75B_ADDR, &amp;amp;m_sample, sizeof(m_sample));
     ble_nus_data_send(&amp;amp;m_nus,str,sizeof(m_sample), m_conn_handle);
      
  
}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160516?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 09:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48817eb9-212c-43bb-9c6d-4e71d44af334</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, but I am still not sure what type of interrupt you want. Does the sensor that generate a interrupt signal, so that you just want to wake the nRF up on a pin interrupt? If so you can refer to the &lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/pin_change_int_example"&gt;Pin Change Interrupt Example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160513?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 08:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12b07c36-31c8-411e-9016-5fe00e26940e</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;&amp;nbsp;i have called sd_app_evt_wait() in main loop&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but it doesn&amp;#39;t go to sleep&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Application main function.
 */
int main(void)

{
    bool erase_bonds;

    // Initialize.
    uart_init();
    log_init();
    timers_init();
    buttons_leds_init(&amp;amp;erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();
    


    // Start execution.
    printf(&amp;quot;\r\nUART started.\r\n&amp;quot;);
    NRF_LOG_INFO(&amp;quot;Debug logging for UART over RTT started.&amp;quot;);
    advertising_start();
    
    twi_init();
    LM75B_set_mode();
    
      while (true)
    {
        nrf_delay_ms(5000);

        do
        {
            __WFE();
        }while (m_xfer_done == false);
      
     
       
        // read_sensor_data();
       //  power_manage();
         threshold_value();
      sd_app_evt_wait();
        NRF_LOG_FLUSH();
    }
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;help me&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160501?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 06:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa79f025-0c9b-4088-b28b-31fbd154f8db</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;did you get my question .........&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160448?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 16:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ae58aa1-f186-4f08-8d0f-77924e69bf6e</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;sorry for worse ....&amp;nbsp; i will explain the process what i want to do ?&lt;/p&gt;
&lt;p&gt;step&amp;nbsp; by step&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;start ------&amp;gt; put the device in sleep mode ----------&amp;gt;&amp;gt; wake up by interrupting the sensor(using threshold)---------&amp;gt; send the data over ble_nus to ble_uart app --------------&amp;gt;&amp;gt; again it should go to sleep mode&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;is it possibleto to do above process ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160443?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 15:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a400e22-1a0f-46db-9217-831b78038ac1</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;HI....Einar ...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here , i have the attached the step by step process.. what actually i want to do ...&lt;/p&gt;
&lt;p&gt;tell me is it possible or not&amp;nbsp;&lt;/p&gt;
&lt;p&gt;pls see the pic&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2018_2D00_12_2D00_05-at-9.27.15-PM.jpeg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160396?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 13:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71192f62-f375-4e55-a4e3-1959782e5eb1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Please be a bit more verbose in your questions, that way we will be able to help you much better. I still have no idea about how your system is intended to work and how you interact with the sensor and how you intend to trigger wakeup of the nRF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160379?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:47:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38c2a93a-1f7a-4f6f-bf89-8cc75f98bd2b</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;i want to put my device in sleep mode and wake up by interrupting the sensor&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160378?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:46:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4400fe35-d39b-4d51-ad67-8d3a2db53e7b</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;is it possible to put in sleep mode before reading the thershold&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160376?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4167ed4-46d6-4445-a6fa-4b49cdab06b7</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;No... not like that ....... if it attains the threshold only it will send the data over ble until it will never enter the ble_nus&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160373?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:37:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d7ef942-c5f1-4e85-93f4-7f2efb395302</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please elaborate. What&amp;nbsp;threshold point? How will you know that it has been hit? If it requires reading the temperature sensor, then clearly the nRF cannot sleep until the temperature reaches the threshold, as the nRF has no way of knowing. Without full information it seems to me that you need to wake up regularly to read the temperature sensor, and then do some task if the temperature has crossed your threshold. If that is the case you could for instance use the &lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_timer"&gt;timer library&lt;/a&gt; to wake up regularly to measure the temperature.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160367?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e49abc0-3405-467d-983f-de72f9d61275</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;i am using temperature sensor .. i used the if condition ... if it reaches above the certain value in temperature then it should send the data in ble_uart app ,and then put the device in sleep mode .... in this case i want my device in sleep mode until the threshold point ......&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160363?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:16:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b155423a-0cf5-4bc4-9f56-4c50cccd51dd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What do you mean by &amp;quot;it attains threshold&amp;quot;? Do you want to trigger an interrupt when the voltage on a GPIO crosses a certain threshold? If so you could for instance use the LPCOMP.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160341?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 10:44:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d88c9812-261d-4c52-98bc-d2da1397b4b7</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;hi.... Einar ... i am confused how to put device in sleep mode before entering into process or function...&lt;/p&gt;
&lt;p&gt;i want my device to sleep until it attains threshold ,, it will wake up by threshold and again it should go to sleep&amp;nbsp;&lt;/p&gt;
&lt;p&gt;how ??&lt;/p&gt;
&lt;p&gt;suggest an idea&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160199?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 12:49:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c04295f9-e4f8-4f6c-be3c-a3e1ca99fef0</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;thank you so much ... Einar ... i will implement it and get back&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160181?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 11:50:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6801f794-0afb-414d-9f2e-c8a771ae4f9b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You put it in sleep mode by calling&amp;nbsp;sd_app_evt_wait() again. If you look at most of the SoftDevice examples you can see that they call&amp;nbsp;sd_app_evt_wait() in the main loop. This way it always gets called&amp;nbsp;once the interrupts have been processed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up from sleep mode</title><link>https://devzone.nordicsemi.com/thread/160180?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 11:47:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:631bd504-6fc7-40b4-a985-1b430adc4759</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;hi... Einar&lt;/p&gt;
&lt;p&gt;Once I put in sleep mode it will wake up by interrupt and send the data and again I want to put in sleep mode after sending data how ?? Can I put the sleep mode again&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>