<?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>Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66953/wake-up-from-system-off-using-lpcomp</link><description>H i everyone, I&amp;#39;m having a problem as follows: I am wanting to use LPCOMP to wake up the nrf52840 from system off mode. So can anyone give me an idea of ​​how to do that?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Oct 2020 07:46:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66953/wake-up-from-system-off-using-lpcomp" /><item><title>RE: Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/thread/275269?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 07:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9b1d352-c950-4d41-b1d3-b5cfbb6bf4c8</guid><dc:creator>Judge</dc:creator><description>&lt;div class="hidden"&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;Hi, use sd_power_system_off() to put the system into system off, but as long as I turn off the config.hal.detection configuration, the system will automatically reboot when there is an impact on the AIN2 pin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void lpcomp_handler(nrf_lpcomp_event_t event)
{
    NRF_LPCOMP-&amp;gt;EVENTS_DOWN = 0;
    NRF_LPCOMP-&amp;gt;EVENTS_UP = 0;
    NRF_LPCOMP-&amp;gt;EVENTS_CROSS = 0;
}
void lpcomp_init(void)
{
    uint32_t err_code;
    nrf_gpio_pin_clear(NRF_LPCOMP_INPUT_2);

    nrf_drv_lpcomp_config_t config = NRF_DRV_LPCOMP_DEFAULT_CONFIG;
    config.hal.reference = NRF_LPCOMP_REF_SUPPLY_4_8;
    config.hal.hyst = NRF_LPCOMP_HYST_50mV;
    config.input = NRF_LPCOMP_INPUT_2;
    //config.hal.detection = NRF_LPCOMP_DETECT_UP;

    // init
    err_code = nrf_drv_lpcomp_init(&amp;amp;config, lpcomp_handler);
    APP_ERROR_CHECK(err_code);
    // enable
    nrf_drv_lpcomp_enable();
    // Lpcomp ready
    NRF_LPCOMP-&amp;gt;TASKS_START = 1;
    while(NRF_LPCOMP-&amp;gt;EVENTS_READY == 0);
    NRF_LPCOMP-&amp;gt;EVENTS_READY = 0;

    sd_power_system_off();
}&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/thread/275268?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 07:44:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5537bd01-e707-4087-bb28-f9d239d48b29</guid><dc:creator>Judge</dc:creator><description>&lt;div class="translate-tooltip-mtz hidden"&gt;
&lt;div class="header"&gt;
&lt;div class="header-controls"&gt;&lt;span class="sound-translate"&gt;&lt;/span&gt; &lt;span class="settings"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="translate-icons"&gt;
&lt;div class="hidden"&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;Hi, use sd_power_system_off() to put the system into system off, but as long as I turn off the config.hal.detection configuration, the system will automatically reboot when there is an impact on the AIN2 pin&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div class="translated-text"&gt;
&lt;div class="words"&gt;&lt;/div&gt;
&lt;div class="sentences"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class="translate-button-mtz hidden"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="translate-tooltip-mtz hidden"&gt;
&lt;div class="header"&gt;
&lt;div class="header-controls"&gt;&lt;span class="sound-translate"&gt;&lt;/span&gt; &lt;span class="settings"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="translate-icons"&gt;  &lt;/div&gt;
&lt;/div&gt;
&lt;div class="translated-text"&gt;
&lt;div class="words"&gt;&lt;/div&gt;
&lt;div class="sentences"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class="translate-button-mtz hidden"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="translate-tooltip-mtz hidden"&gt;
&lt;div class="header"&gt;
&lt;div class="header-controls"&gt;&lt;span class="sound-translate"&gt;&lt;/span&gt; &lt;span class="settings"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="translate-icons"&gt;  &lt;/div&gt;
&lt;/div&gt;
&lt;div class="translated-text"&gt;
&lt;div class="words"&gt;&lt;/div&gt;
&lt;div class="sentences"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class="translate-button-mtz hidden"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="translate-tooltip-mtz hidden"&gt;
&lt;div class="header"&gt;
&lt;div class="header-controls"&gt;&lt;span class="sound-translate"&gt;&lt;/span&gt; &lt;span class="settings"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="translate-icons"&gt;  &lt;/div&gt;
&lt;/div&gt;
&lt;div class="translated-text"&gt;
&lt;div class="words"&gt;&lt;/div&gt;
&lt;div class="sentences"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class="translate-button-mtz hidden"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/thread/275115?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 13:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d930ad71-fa31-4634-925b-ba2a8b486346</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;it&amp;#39;s not my example, I just put a link here )&lt;/p&gt;
&lt;p&gt;Do you mean that the system wakes up from SYSTEM OFF or WFE? As long as LPCOMP is enabled, it will wake up the system from WFE state on crossing threshold, but it should not do that from SYSTEM OFF when ANADETECT is not configured.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/thread/275001?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 08:20:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1486550-4bb8-40f3-bce4-848244d1156c</guid><dc:creator>Judge</dc:creator><description>&lt;p&gt;Hi dmitry,&amp;nbsp;Many thanks for your example. But now I am having a problem: when I set up that LPCOMP pin AIN2 I turned off the anadetect signal, but as long as I have an impact on that pin, whatever my system wakes me up. know why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake up from system off using LPCOMP</title><link>https://devzone.nordicsemi.com/thread/274139?ContentTypeID=1</link><pubDate>Sat, 10 Oct 2020 09:17:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5009104-c94d-465a-b2c5-c817a5457d9f</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;please look &lt;a href="https://github.com/andenore/NordicSnippets/tree/master/examples/lpcomp"&gt;here&lt;/a&gt; for an example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>