<?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>nRF52 Level-triggered Interrupts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109182/nrf52-level-triggered-interrupts</link><description>Hi all! 
 
 It seems that an edge-triggered (rising/falling) interrupt is quite easy to implement, but such interrupts are subject to a number of possible racing conditions. 
 I would like to implement a classic level-triggered interrupt. 
 Is this possible</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Mar 2024 17:12:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109182/nrf52-level-triggered-interrupts" /><item><title>RE: nRF52 Level-triggered Interrupts</title><link>https://devzone.nordicsemi.com/thread/473510?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 17:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bda50865-1005-4563-ad54-9253942f5e18</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Not what you seek, as Events are edge-triggered, but Interrupts are level-triggered. An enabled event triggers on an &amp;quot;edge&amp;quot; and remains &amp;quot;set&amp;quot; until manually cleared by either SHORT, PPI or firmware. An enabled interrupt triggered from such an enabled-and-triggered Event remains &amp;quot;active&amp;quot; and will trigger the interrupt handler until the&amp;nbsp;corresponding Event is cleared or the interrupt disabled. Typically the interrupt handler clears the&amp;nbsp;&lt;span&gt;enabled-and-triggered Event which stops the interrupt occurring&amp;nbsp;until the next event; if the interrupt does not clear the&amp;nbsp;enabled-and-triggered Event then on return-from-interrupt is followed by the same interrupt&amp;nbsp;handler invocation&amp;nbsp;often using tail-chaining.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Side-effects include clearing the&amp;nbsp;enabled-and-triggered Event as the very last instruction in the interrupt handler; since the peripheral register is on a separate bus and uses a 16MHz clock, the 64MHz instruction bus invokes a second unwanted interrupt handler via tail-chaining before that event gets cleared. This can be avoided by inserting extra instructions after the event clear, reading back the register or (better) by inserting a&amp;nbsp;&lt;em&gt;__DSB()&lt;/em&gt; after the event clear. This discussion applies to the nRF52 series; not tested nRF53 or nRF54 for this yet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding the GPIO; no, this is not what you are seeking &amp;quot;&lt;em&gt;The ISR should never stop&amp;nbsp;repeatedly executing until the&amp;nbsp;GPIO level is changed to the inactive state&lt;/em&gt;&amp;quot; unless a pin input check is made within the interrupt which as noted can lead to interrupt thrashing.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>