<?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>GPIO and COMP strange behavior</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47888/gpio-and-comp-strange-behavior</link><description>Im trying to detect power off. The signal power off looks like: 
 
 The time to get 0V equal 15seconds. GPIO EVENT and COMP do not see changes in the voltage level, they are blind. 
 But when signal looks like 
 
 then it works fine. 
 COMP works with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Jun 2019 13:04:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47888/gpio-and-comp-strange-behavior" /><item><title>RE: GPIO and COMP strange behavior</title><link>https://devzone.nordicsemi.com/thread/191123?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 13:04:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1447a789-c440-4867-8f53-3afff424144b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The issue can be related to &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_113.html?cp=3_1_1_0_1_32"&gt;this errata&lt;/a&gt;. Could you try using the LPCOMP instead and see if you experience the same issue? Also, notice &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_76.html?cp=3_1_1_0_1_16"&gt;this&lt;/a&gt; errata regarding LPCOMP.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO and COMP strange behavior</title><link>https://devzone.nordicsemi.com/thread/190251?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 10:55:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f67c1c5e-da68-4568-84d6-b2b5f01b3150</guid><dc:creator>BartoszT</dc:creator><description>&lt;p&gt;Initialization code&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NRF_GPIO-&amp;gt;PIN_CNF[4]=0x04;  // INPUT - AnalogInput2
    NRF_GPIO-&amp;gt;PIN_CNF[9]=0x03;  // OUTPUT - LED

    NRF_COMP-&amp;gt;PSEL=COMP_PSEL_PSEL_AnalogInput2;
    NRF_COMP-&amp;gt;MODE=COMP_MODE_MAIN_SE&amp;lt;&amp;lt;COMP_MODE_MAIN_Pos;   
    
    NRF_COMP-&amp;gt;REFSEL=COMP_REFSEL_REFSEL_Int1V2&amp;lt;&amp;lt;COMP_REFSEL_REFSEL_Pos;
    NRF_COMP-&amp;gt;TH|= (5&amp;lt;&amp;lt;COMP_TH_THDOWN_Pos) | 5&amp;lt;&amp;lt;COMP_TH_THUP_Pos;
    NRF_COMP-&amp;gt;HYST=COMP_HYST_HYST_Hyst50mV;

    NRF_COMP-&amp;gt;INTENSET= (COMP_INTEN_UP_Enabled&amp;lt;&amp;lt;COMP_INTEN_UP_Pos) | (COMP_INTEN_DOWN_Enabled&amp;lt;&amp;lt;COMP_INTEN_DOWN_Pos);

    NRF_COMP-&amp;gt;ENABLE=COMP_ENABLE_ENABLE_Enabled;

    NVIC_SetPriority( COMP_LPCOMP_IRQn, 0 );
	NVIC_ClearPendingIRQ( COMP_LPCOMP_IRQn );
    NVIC_EnableIRQ(COMP_LPCOMP_IRQn);
		
	NRF_COMP-&amp;gt;TASKS_START=1;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Interrupt Code&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void COMP_LPCOMP_IRQHandler(void)
{
	NVIC_ClearPendingIRQ( COMP_LPCOMP_IRQn );

	NRF_COMP-&amp;gt;EVENTS_READY=0;
	NRF_COMP-&amp;gt;EVENTS_DOWN=0;
	NRF_COMP-&amp;gt;EVENTS_UP=0;
	NRF_COMP-&amp;gt;EVENTS_CROSS=0;


	if(NRF_COMP-&amp;gt;RESULT==1)
	NRF_GPIO-&amp;gt;OUTCLR=1&amp;lt;&amp;lt;9;
	else
	NRF_GPIO-&amp;gt;OUTSET=1&amp;lt;&amp;lt;9;

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO and COMP strange behavior</title><link>https://devzone.nordicsemi.com/thread/190231?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 10:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ab78115-f1fc-42cb-a961-0647e43c75ca</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using the COMP in differential or in signal ended mode? What are you using as a reference voltage? Could you share the code that you&amp;#39;re using to sense the signal change?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>