<?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>nRF9160 interrupt on pin change</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71316/nrf9160-interrupt-on-pin-change</link><description>Which digital IO pins on the nRF9160 support interrupt on pin change? 
 I&amp;#39;m implementing an antenna MUX control routine where the MUX control (3 pins out of nRF9160) depends on 3 pins in (need interrupt on change on all three) and internal states of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Feb 2021 13:54:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71316/nrf9160-interrupt-on-pin-change" /><item><title>RE: nRF9160 interrupt on pin change</title><link>https://devzone.nordicsemi.com/thread/292936?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 13:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:828d013f-be12-4716-a9ce-8d818f5a0ea0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Børge,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I&amp;#39;m implementing an antenna MUX control routine where the MUX control (3 pins out of nRF9160) depends on 3 pins in (need interrupt on change on all three) and internal states of the nRF9160. This is essentially a look-up table. It contains very little code but must run quickly after an external pin change is detected.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Switching in/out antennas for the nRF9160? I would recommend that you look at MAGPIO/COEX if that is the case. The Thingy91 hardware files also includes more complex switching, although for antenna tuners and not the antenna itself.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If this is other sorts of switching (ie. application specific switching), you can use either the GPIOTE PORT event or a dedicated GPIOTE IN channel to detect (rising or falling edge).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A GPIOTE IN channel consumes approx. 30 uA in sleep. GPIOTE PORT event (level triggered wake condition) is lower power.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Which digital IO pins on the nRF9160 support interrupt on pin change?[/quote]
&lt;p&gt;&amp;nbsp;Any unused GPIO. The pin crossbar is configurable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]What is the deepest sleep mode where the nRF9160 can still have a quick interrupt handle response to external pin change?[/quote]
&lt;p&gt;Imcuonidle, also known as systemon idle mode on the nRF5-series devices. The systemoff mode will be reset on wakeup condition, so that isn&amp;#39;t quick.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is your timing requirement for handling the pin-change?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;you can try this example to evaluate:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/basic/button/src/main.c#L71"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/basic/button/src/main.c#L71&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That specific line enables GPIOTE IN channel to be used, actually; all EDGE configurations do.&lt;/p&gt;
&lt;p&gt;While if you change to a specified level, like GPIO_INT_LEVEL_HIGH, it will use GPIOTE PORT event (lower power, but might not work for your scenario)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>