<?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 from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124214/wake-from-systemoff-with-lpcomp-anadetect-varying-vdd</link><description>I&amp;#39;m using the board RAK19007 with its RAK4630 nrf52840, meant for solar and battery, where the AIN3 (P0.05) comes from a voltage divider of VBAT, where AIN3 = VBAT*(1.5M/2.5M). The Thevenin equivalent resistor should be 600KOhm. 
 The nrf52840 is powered</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Sep 2025 20:54:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124214/wake-from-systemoff-with-lpcomp-anadetect-varying-vdd" /><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/548289?ContentTypeID=1</link><pubDate>Tue, 09 Sep 2025 20:54:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e684b5f-67a6-4c13-84d2-519faec262cc</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;I finally solved the situation.&lt;/p&gt;
&lt;p&gt;To get LPCOMP ANADETECT to work I missed two steps before the system off: START the task, and wait for its READY event.&lt;/p&gt;
&lt;p&gt;When GPIO DETECT was not working for me is because I was not getting into system-off, due to some other complex bug of the whole software. Once I solved that, GPIO DETECT worked fine as well.&lt;/p&gt;
&lt;p&gt;I cannot tell about the unexpected reset sources I had while I was doing all this. Other pieces of the whole software I don&amp;#39;t know about, probably.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/548112?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2025 22:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b057f9e-0318-4564-80de-cb190ef19840</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;I already removed the ram retention part and now it doesn&amp;#39;t reset.&lt;/p&gt;
&lt;p&gt;I tried LPCOMP + ANADETECT, and reset does not occur for me (code in prev post).&lt;/p&gt;
&lt;p&gt;I also tried GPIO as well, without success. No reset when I connect the pin to 3V3:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;        NRF_P0-&amp;gt;PIN_CNF[31] = ((uint32_t)GPIO_PIN_CNF_DIR_Input        &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos)
                           | ((uint32_t)GPIO_PIN_CNF_INPUT_Connect    &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos)
                           | ((uint32_t)GPIO_PIN_CNF_PULL_Pulldown    &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos)
                           | ((uint32_t)GPIO_PIN_CNF_DRIVE_S0S1       &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos)
                           | ((uint32_t)GPIO_PIN_CNF_SENSE_High   &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
        NRF_P0-&amp;gt;DETECTMODE = 0;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Am I missing something in LPCOMP or GPIO to get the wakeup?&lt;/p&gt;
&lt;p&gt;Do I need to set up interrupts in any particular way?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/548099?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2025 18:10:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94393ad0-8b2c-4943-8976-d2ab9428601b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can try to disable global interrupts before executing this, and in that case also use directly NRF_POWER-&amp;gt;SYSTEMOFF = 1; (if I remember correctly). On wakeup you can try to double check that it&amp;#39;s waking up from system off reset (and not a soft reset due to fatal error or similar) by reading the RESETREAS register:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title35"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title35&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe it&amp;#39;s another wakeup source happening here.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/548006?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2025 02:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aea6ad00-49a4-4707-83c2-4ba131d0f2cb</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;I&amp;#39;m trying a simpler scenario with stable VDDH (USB power) without any code about ram retention, and it still doesn&amp;#39;t work:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;        // Wake up if power rises again
        pinMode(31, INPUT);
        nrf_lpcomp_config_t c;
        c.reference = NRF_LPCOMP_REF_SUPPLY_4_8;
        c.detection = NRF_LPCOMP_DETECT_UP;
        c.hyst = NRF_LPCOMP_HYST_NOHYST;
        nrf_lpcomp_configure(NRF_LPCOMP, &amp;amp;c);
        nrf_lpcomp_input_select(NRF_LPCOMP, NRF_LPCOMP_INPUT_7);
        nrf_lpcomp_enable(NRF_LPCOMP);

        auto ok = sd_power_system_off();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using AIN7. The pin is connected to GND, and once system is off, I connect it to 3V3. It does not reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/547995?ContentTypeID=1</link><pubDate>Sun, 07 Sep 2025 18:06:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8335b888-735a-4b43-8ccc-85750bcd60dc</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;It seems that if I remove the code piece about RAM retention (in code in original post) then there is no reset.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what relationship there is between the ram systemoff retention code and the NRESET line, but the correlation is clear. If the for loop about disabling off ram retention is present, NRESET occurs. If I remove the code, there is no reset and LPCOMP doesn&amp;#39;t seem to wake up the device ever, when rising VBAT voltage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/547994?ContentTypeID=1</link><pubDate>Sun, 07 Sep 2025 17:03:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8487e384-524c-4115-906f-c7e61dd998e8</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;I checked the NRESET pin and it has the same shape&amp;nbsp; as VDD, so I guess some part of the circuit is pulling NRESET down. That is the piece that is disturbing in my setup I think. I will have to find this out.&lt;/p&gt;
&lt;p&gt;Yellow=NRESET, Blue=VDD&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Yellow_2D00_NRST_2D00_Blue_2D00_VDD.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/547993?ContentTypeID=1</link><pubDate>Sun, 07 Sep 2025 16:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:900f4017-25fa-4cea-a6a0-3a144e86b1a6</guid><dc:creator>viric</dc:creator><description>&lt;p&gt;By now I&amp;#39;m checking with a lab regulable voltage supply, choosing the voltage I want in VBAT. The device will have a Li-Ion battery and specifically I want to go System-Off long before it reaches BOR, because in BOR all hangs forever.&lt;/p&gt;
&lt;p&gt;I think I found an important surprise with the oscilloscope on VDD (generated by REG0) testing the systemoff-&amp;gt;wakeup. As for AIN3 (the high ohm resistors) I cannot see any oscillation at all with the oscilloscope.&lt;/p&gt;
&lt;p&gt;VDD seems to go down at some moment related to the SystemOff-&amp;gt;reboot. I don&amp;#39;t have any other time reference to the event.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/VDD_2D00_with_2D00_LPCOMP_2D00_start.png" /&gt;&lt;/p&gt;
&lt;p&gt;If I don&amp;#39;t enable the LPCOMP I see a longer pause yet it reboots as well. Strange.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/VDD_2D00_without_2D00_LPCOMP_2D00_start.png" /&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why the device restarts with LPCOMP disabled.&lt;/p&gt;
&lt;p&gt;I also don&amp;#39;t know why VDD=3V3, if I am not setting this up; I read that the default should be 1.8V from the REG0. And I don&amp;#39;t understand why it falls to 1.62V (from the oscilloscope pictures).&lt;/p&gt;
&lt;p&gt;I have to mention that apparently the same code yesterday had a good LPCOMP restart, but today it is restarting apparently no matter what, and I don&amp;#39;t know why.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake from SystemOFF with LPCOMP ANADETECT, varying VDD</title><link>https://devzone.nordicsemi.com/thread/547992?ContentTypeID=1</link><pubDate>Sun, 07 Sep 2025 15:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9c8b1c3-2d52-457c-a242-30c40dd15762</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;What battery do you use? Many LiPo can&amp;#39;t supply enough power when they go below ~3.0Volts. You might be triggering BOR/POR - check voltages with an oscilloscope.&lt;/p&gt;
&lt;p&gt;High ohms input can work as an antenna. Make sure that you have a properly sized capacitor on it...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>