<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Level Sensitive Interrupt Issue in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Level-Sensitive-Interrupt-Issue/m-p/580685#M20260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by VictorValencia on Mon Oct 14 14:54:22 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I am running into an issue using level sensitive interrupts on the LPC 4337.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a level-sensistive (low) interrupt configured for a simple gpio interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;test.&amp;nbsp; The trigger pin is direct connected to the interrupt pin.&amp;nbsp; The intention is to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set the trigger pin low and verify that an interrupt is generated on the "interrupt" pin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The primary gpio ISR will write the appropriate bit in the PSTAT register to acknowledge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the interrupt but only for edge-triggered interrupts.&amp;nbsp; According to the reference manual for &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;level sensitive interrupts a write to PSTAT will reverse the level trigger sense (from low to high) to &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;disable further interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the original code does&amp;nbsp; this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;start test&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;trigger gpio pin is set low&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;interrupt occurs on interrupt pin&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ISR runs&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (intType == edge)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write appropriate bit to PSTAT;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set the trigger pin high;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;test complete&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am finding is that if the ISR does not write PSTAT (due to int not being edge triggered) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and only sets the trigger pin high the interrupt keeps firing.&amp;nbsp; Since the trigger pin becomes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;high the interrupt condition is not present and the interrupts should stop.&amp;nbsp; If I instead change &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the code to unconditionally write the PSTAT register (regardless of interrupt type) everything &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;works fine (just get one interrupt).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It acts as if setting the trigger pin low does not stop the interrupt from firing.&amp;nbsp; If I change the code &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to unconditionally write the PSTAT (regardless of interrupt type) then there might be the unintended &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;consequence that a subsequent change of the trigger pin to a high state will generate another interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The fundamental question is why doesn't removing the interrupt condition by itself stop interrupts from&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;occurring?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why this is happening?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Victor&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:08:21 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:08:21Z</dc:date>
    <item>
      <title>Level Sensitive Interrupt Issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Level-Sensitive-Interrupt-Issue/m-p/580685#M20260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by VictorValencia on Mon Oct 14 14:54:22 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I am running into an issue using level sensitive interrupts on the LPC 4337.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a level-sensistive (low) interrupt configured for a simple gpio interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;test.&amp;nbsp; The trigger pin is direct connected to the interrupt pin.&amp;nbsp; The intention is to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set the trigger pin low and verify that an interrupt is generated on the "interrupt" pin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The primary gpio ISR will write the appropriate bit in the PSTAT register to acknowledge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the interrupt but only for edge-triggered interrupts.&amp;nbsp; According to the reference manual for &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;level sensitive interrupts a write to PSTAT will reverse the level trigger sense (from low to high) to &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;disable further interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the original code does&amp;nbsp; this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;start test&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;trigger gpio pin is set low&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;interrupt occurs on interrupt pin&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ISR runs&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (intType == edge)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write appropriate bit to PSTAT;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set the trigger pin high;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;test complete&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am finding is that if the ISR does not write PSTAT (due to int not being edge triggered) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and only sets the trigger pin high the interrupt keeps firing.&amp;nbsp; Since the trigger pin becomes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;high the interrupt condition is not present and the interrupts should stop.&amp;nbsp; If I instead change &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the code to unconditionally write the PSTAT register (regardless of interrupt type) everything &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;works fine (just get one interrupt).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It acts as if setting the trigger pin low does not stop the interrupt from firing.&amp;nbsp; If I change the code &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to unconditionally write the PSTAT (regardless of interrupt type) then there might be the unintended &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;consequence that a subsequent change of the trigger pin to a high state will generate another interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The fundamental question is why doesn't removing the interrupt condition by itself stop interrupts from&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;occurring?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why this is happening?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Victor&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:08:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Level-Sensitive-Interrupt-Issue/m-p/580685#M20260</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:08:21Z</dc:date>
    </item>
  </channel>
</rss>

