<?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>sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11110/sleep-mode-in-nrf51822</link><description>hello there i want to put my nrf51822 in sleep mode when it is not advertising. can you tell me how to do it?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Jan 2016 17:12:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11110/sleep-mode-in-nrf51822" /><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41610?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 17:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1af124e-dca2-483d-bc2e-e21fb22d6ce7</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Just for clarification:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;__WFE()&lt;/strong&gt;: Short for Wait For Event. Will put the CPU in system ON sleep mode. This is done in sd_app_evt_wait() function (located in power_manage() in the SDK examples). The CPU will wake up on any event.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sd_power_system_off()&lt;/strong&gt;: Will put the CPU in system OFF sleep mode. The CPU can only wake up on gpio (which is configured in bsp_btn_ble_sleep_mode_prepare()).&lt;/p&gt;
&lt;p&gt;See this &lt;a href="https://devzone.nordicsemi.com/question/61646/can-someone-explain-to-me-how-nordic-nrf51822-sleep-mode-works/"&gt;post&lt;/a&gt; for and the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.pdf.ps/nRF51822_PS_v3.1.pdf"&gt;Product Specifcation&lt;/a&gt; more info and for how much current is consumed in the different modes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41609?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 00:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8185186-14c7-4286-bee7-dbe2698f28dd</guid><dc:creator>xtting</dc:creator><description>&lt;p&gt;app_trace_init();
timers_init();
buttons_leds_init(&amp;amp;erase_bonds);
ble_stack_init();
You can see all these in main function, what you need to see is advertising_init() here.&lt;/p&gt;
&lt;p&gt;And many MACROs like these:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define APP_ADV_TIMEOUT_IN_SECONDS      10
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41611?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 11:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af1d2def-7fdf-453c-87e8-00c604d122b1</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;sorry i can&amp;#39;t understand xxx_init function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41608?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 01:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c782f784-933c-4bef-abb6-fe30a495379d</guid><dc:creator>xtting</dc:creator><description>&lt;p&gt;hello,&lt;/p&gt;
&lt;p&gt;when ADV, the time out timer is defined automatically when you do the adv_init. You need don&amp;#39;t add another timer to do this.&lt;/p&gt;
&lt;p&gt;I advise you go deep into the xxx_init function. And you can see many MACROs in main.c in each demo, there&amp;#39;s many time_out define.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41606?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 14:14:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a84402e1-b848-47d1-8749-f50bb3ad16f0</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;In BLE uart application. i also find  function for sleep mode&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; static void sleep_mode_enter(void)
    {
        uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
        APP_ERROR_CHECK(err_code);
    
        // Prepare wakeup buttons.
        err_code = bsp_btn_ble_sleep_mode_prepare();
        APP_ERROR_CHECK(err_code);
    
        // Go to system-off mode (this function will not return; wakeup will cause a reset).
        err_code = sd_power_system_off();
        APP_ERROR_CHECK(err_code);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;i think i can use it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41607?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 13:16:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48356e0-9132-4228-ae64-17927146d1d2</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;hello there &lt;a href="https://github.com/NordicSemiconductor/nrf51-TIMER-examples"&gt;link text&lt;/a&gt; .in this timer example. they used __WFE(); for sleep mode.  can i use timer and __WFE();  with advertising ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41605?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 09:33:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ea4b7dd-3174-49e6-bca1-68b20742d3b1</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;can we add time? like after 5 s nrf51822 goes into sleep mode&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/41604?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 01:00:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48ee3c3d-517b-46f4-adfa-3f4998925903</guid><dc:creator>xtting</dc:creator><description>&lt;p&gt;you can see it in most demo.&lt;/p&gt;
&lt;p&gt;I can tell you most of this operation occur is when the ADV (fast ADV / Slow ADV / direct ADV, etc.) time out. So you can find it in the adv time out call back function. And slow ADV is always the last ADv type, then go to sleep. You can find what you want by search BLE_ADV_EVT_IDLE.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_ADV_MODE_SLOW:
                    m_adv_evt = BLE_ADV_EVT_IDLE;
                    LOG(&amp;quot;[ADV]: Timed out from slow advertising, stopping advertising.\r\n&amp;quot;);
                    if (m_evt_handler != NULL)
                    {
                        m_evt_handler(m_adv_evt);
                    }
                    break;


static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    uint32_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            APP_ERROR_CHECK(err_code);
            break;
        case BLE_ADV_EVT_IDLE:
            sleep_mode_enter();
            break;
        default:
            break;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>