<?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 can I detect the state of an LPCOMP input?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21598/how-can-i-detect-the-state-of-an-lpcomp-input</link><description>I am programming a device with a NF52 that uses a hall effect switch o enter/exit sleep mode when BLE is in advertising mode. When connected, It will generate a separate BLE notification for the condition that a magnet is present or not. 
 I have the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 May 2017 07:51:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21598/how-can-i-detect-the-state-of-an-lpcomp-input" /><item><title>RE: How can I detect the state of an LPCOMP input?</title><link>https://devzone.nordicsemi.com/thread/84792?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 07:51:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a191754-c03a-45e0-ac21-c41d0f2653b2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi gannerud,&lt;/p&gt;
&lt;p&gt;Yes, that is correct. For each CROSS event there will also either be a UP or DOWN event also. But you can individually configure on which of these events an interrupt should be triggered. Using the LPCOMP driver in the SDK you can either configure for a DOWN, UP or CROSS event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I detect the state of an LPCOMP input?</title><link>https://devzone.nordicsemi.com/thread/84791?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 06:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03e0e3f0-1a4b-471b-9097-0cbdbca38197</guid><dc:creator>gannerud</dc:creator><description>&lt;p&gt;Not according to the nrf52 Product Specification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The LPCOMP will generate events every time VIN+ crosses VIN-. More specifically, every time
VIN+ rises above VIN- (upward crossing) an UP event is generated along with a CROSS event. Every time
VIN+ falls below VIN- (downward crossing), a DOWN event is generated along with a CROSS event.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But in reality it seems to be the way Sigurd said, you only get an CROSS event. Can someone from Nordic clarify this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I detect the state of an LPCOMP input?</title><link>https://devzone.nordicsemi.com/thread/84790?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 07:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7cd33f9-5e33-4f99-b1e6-deb368fad9b4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you have configured for CROSS event, you will get an event called &lt;code&gt;NRF_LPCOMP_EVENT_CROSS&lt;/code&gt;. So you need to look for that event in your LPCOMP event handler.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (event == NRF_LPCOMP_EVENT_CROSS) { ...do something }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>