<?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 the device by using threshold</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45054/how-to-wake-up-the-device-by-using-threshold</link><description>hi ... i am using nRF52832 ,i want to save the battery so i am planning to use system off mode . how to wake up the device from system off mode using threshold value or either system on mode 
 
 is it possible ? how to do 
 
 
 
 
 
 Thanks in advanc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Mar 2019 16:42:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45054/how-to-wake-up-the-device-by-using-threshold" /><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177666?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 16:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2af7946c-4439-4867-b69e-a27c3a826670</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;One more,, i tried to &amp;nbsp;advertise &amp;nbsp;when i need to send data using fimer . I have tried alot after advertising , data is not transfering i am getting fatal error why ? I &amp;nbsp;need to advdrtise only when i need then send the data &amp;nbsp;and disconnect . flow like &amp;nbsp;check the threshold using timer ----advertise start -----if &amp;nbsp; connected-----send the data ----and then disconnect .. i am achieving upto connected state after that i am getting fatal error . How to solve ? Is this possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177665?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 16:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e22118d-3c01-4036-83e7-06fabb745021</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;How to do that can you explain me&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177602?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 13:48:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcd262ed-e92f-4f23-be3f-53f37f0016e0</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Not sure what&amp;nbsp; &amp;quot;led pin&amp;quot; is, but yes you can wake the chip up from system OFF using a GPIO pin interrupt signal from the temperature sensor.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177543?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 10:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c40bdc5-4131-43ec-93dc-b9e3902df976</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;led pin to wake up the device from system off mode ..as per option 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177542?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 10:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aee5c7d-ba45-44c1-87cc-a7aab764bfb5</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Using LED pin for what?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177541?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 10:44:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f101e4d7-36c3-4f29-88d5-d5260d390dad</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Ok, so I think you are finished with you code now. It goes to sleep in the idle_state_handle() and wake up using app_timer interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177469?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 02:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05538bff-3963-42ea-bd01-7cf5a2dfe6e4</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;Is it possible for option 1 . if manually&amp;nbsp; i am setting threshold in my program , and by using led pin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177449?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 19:02:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc5fca48-bb9a-4c96-b278-d18c7937da51</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;In&amp;nbsp; time event handler i am comparing threshold&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177448?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 18:57:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e417df2c-85f8-4ae9-96bd-0c9d3662f867</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; */
int main(void)
{
bool erase_bonds;



    // Initialize.
   
    uart_init();
    log_init();
    timers_init();

    ret_code_t err_code =app_timer_create(&amp;amp;m_led_a_timer_id,   APP_TIMER_MODE_REPEATED   ,timer_sensor_event_handler);
APP_ERROR_CHECK(err_code);

    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();

  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();

    err_code = app_timer_start(m_led_a_timer_id,APP_TIMER_TICKS(60000),NULL);
  APP_ERROR_CHECK(err_code);
 


     

twi_init();
 MAX30_set_mode();
    // Start execution.


   

        

      for(;;)
             {
idle_state_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 the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177413?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 15:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30b2d081-477e-4a1b-9ba9-6dbfbd09ca03</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;If you are successful in checking the threshold using timer, there&amp;#39;s not really much more to do. The CPU automatically goes to IDLE between the interrupts, as long as there is a __WFE() in the main loop somewhere. Can you post your main function, then I can have a look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177343?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 13:09:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7148783-6791-430c-904d-09c605d5a364</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;Thank you sitan . option 2 is good , i can go with this , actually i tried using timer to interrupt the sleep but i couldn&amp;#39;t reach . i don&amp;#39;t how to write the flow to interrupt the sleep using timer .. i have succeed upto checking the threshold using timer&amp;nbsp; .can you help me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177312?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 12:04:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7d861a3-3b22-417f-867c-5a9507a85c48</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;ok, so in order to do a comparison in software like you described you need the CPU to be running. Software is running on the CPU. If the CPU is running the chip is by definition not in sleep mode. If you are checking a temperature value in software the chip is already running.&lt;/p&gt;
&lt;p&gt;If you want the chip to sleep and wake up when the sensor reaches a certain temperature level, you have two choices, depending on what type of sensor you have:&lt;br /&gt;&lt;br /&gt;1. Either the temperature sensor itself can be programmed with a threshold-value and it can wake the chip up by asserting a GPIO pin on the chip. This method can wake the chip up either from system OFF mode or system ON mode.&lt;/p&gt;
&lt;p&gt;2. Or, the temperature sensor needs to be periodically polled, and you can check the threshold value in code. This method requires the RTC clock to be running, and the RTC clock will wake the chip up from system ON mode, create an interrupt, and the interrupt will be handled in software. Like this: if(m_sample &amp;gt; threshold). and then go back to sleep&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177304?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 11:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:658d671c-874e-4e4d-b8c4-d8fc49da2f4c</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;threshold mean here i am using temperature sensor , so i am setting the threshold value (manually) and comparing with temperature value . like this&lt;/p&gt;
&lt;p&gt;if(m_sample &amp;gt; threshold)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177246?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 08:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7975867a-6272-4bd7-8660-3c7f74214dce</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;1. Please explain what you mean with &amp;quot;threshold value&amp;quot;.&lt;/p&gt;
&lt;p&gt;2. Please read the links I posted in my previous answer and see if this is useful to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177157?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 17:33:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b99678f4-b058-4526-a5af-4ed667d94c3f</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;Can we wake up by using threshold value&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to wake up the device by using threshold</title><link>https://devzone.nordicsemi.com/thread/177107?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 14:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cab6b7a-a5c2-46bd-b4a2-d5dbf32c26be</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;In system OFF the chip can wake up by the ANADETECT signal, created by the LPCOMP peripheral: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_1#unique_1707892264"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_1#unique_1707892264&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;And from the LPCOMP peripheral: &lt;br /&gt;&lt;br /&gt;The LPCOMP can wake up the system from System OFF by asserting the ANADETECT signal. The ANADETECT signal can be derived from any of the event sources that generate the UP, DOWN and CROSS events. In case of wakeup from System OFF, no events will be generated, only the ANADETECT signal. See the ANADETECT register (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html#register.ANADETECT"&gt;ANADETECT&lt;/a&gt;) for more information on how to configure the ANADETECT signal.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html?cp=2_1_0_38#concept_tdv_zkx_lr"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html?cp=2_1_0_38#concept_tdv_zkx_lr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here is an example in the SDK demonstrating the use of LPCOMP: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lpcomp_example.html?cp=4_0_0_4_5_17"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lpcomp_example.html?cp=4_0_0_4_5_17&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>