<?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 Re: Need KEAZ128 external interrupt handler example in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Need-KEAZ128-external-interrupt-handler-example/m-p/721930#M44232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KEAZ128 has either a single IRQ input or multiple keyboard interrupts.&lt;BR /&gt;Assuming that you are interested in the IRQ pin, which can be on PTA5, PTI0, PTI1, PTI2, PTI3, PTI4, PTI5 or PTI6 (only one at a time) it can be done as follows (example of falling edge with pull-up enabled):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;POWER_UP_ATOMIC(0, IRQ); // enable clocks to the external interrupt module&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_PINSEL0 = (value depending on PTI pin required); // only when PTA5 not used&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC = IRQ_SC_IRQPE; // enable IRQ pin function with pull-up&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;fnEnterInterrupt(irq_IRQ_ID, IRQ_PRIORITY, _IRQ_isr); // enable IRQ interrupt in NVIC and enter handling function&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC |= (IRQ_SC_IRQIE | IRQ_SC_IRQACK); // enable interrupt and reset pending interrupt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the interrupt fires the interrupt is cleared by the handling function with&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC |= (IRQ_SC_IRQACK); // reset the interrupt flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using PTA5 as IRQ input there is one thing that has to be done specially and that is to clear the &lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_SOPT_RSTPE&lt;/STRONG&gt; flag in &lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_SOPT0&lt;/STRONG&gt; so that the pin is no longer the reset pin; this is a write once flag and so writes to this register have to be coordinated carefully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full code for KEA128 IRQ and Keyboard interrupts is in the Open Source code link below, including KEA128 simulation for verifying the functionality (example below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26085i007A6960E24AB11B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis KEA128:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTRK-KEA128.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TRK-KEA128.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KEAZ128Q80.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;S32 Design Studio: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2Fcompilers.html%23S32" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/compilers.html#S32&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Free Open Source solution: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FuTasker%2FuTasker-Kinetis" rel="nofollow" target="_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Working project in 15 minutes video: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fyoutu.be%2FK8ScSgpgQ6M" rel="nofollow" target="_blank"&gt;https://youtu.be/K8ScSgpgQ6M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fsupport.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/support.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2018 01:24:23 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-03-02T01:24:23Z</dc:date>
    <item>
      <title>Need KEAZ128 external interrupt handler example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Need-KEAZ128-external-interrupt-handler-example/m-p/721929#M44231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a driver test software for KEAZ128 that shows how to set up&amp;nbsp;an external interrupt handler?&lt;/P&gt;&lt;P&gt;I wasn't able to find it in the FRDM-KEA-QSP v7 (Quick starter package).&lt;/P&gt;&lt;P&gt;Any pointers / help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI:&lt;/P&gt;&lt;P&gt;I am using s32 Design studio for IDE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 16:39:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Need-KEAZ128-external-interrupt-handler-example/m-p/721929#M44231</guid>
      <dc:creator>indrajitdeshmuk</dc:creator>
      <dc:date>2018-03-01T16:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need KEAZ128 external interrupt handler example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Need-KEAZ128-external-interrupt-handler-example/m-p/721930#M44232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KEAZ128 has either a single IRQ input or multiple keyboard interrupts.&lt;BR /&gt;Assuming that you are interested in the IRQ pin, which can be on PTA5, PTI0, PTI1, PTI2, PTI3, PTI4, PTI5 or PTI6 (only one at a time) it can be done as follows (example of falling edge with pull-up enabled):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;POWER_UP_ATOMIC(0, IRQ); // enable clocks to the external interrupt module&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_PINSEL0 = (value depending on PTI pin required); // only when PTA5 not used&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC = IRQ_SC_IRQPE; // enable IRQ pin function with pull-up&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;fnEnterInterrupt(irq_IRQ_ID, IRQ_PRIORITY, _IRQ_isr); // enable IRQ interrupt in NVIC and enter handling function&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC |= (IRQ_SC_IRQIE | IRQ_SC_IRQACK); // enable interrupt and reset pending interrupt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the interrupt fires the interrupt is cleared by the handling function with&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;IRQ_SC |= (IRQ_SC_IRQACK); // reset the interrupt flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using PTA5 as IRQ input there is one thing that has to be done specially and that is to clear the &lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_SOPT_RSTPE&lt;/STRONG&gt; flag in &lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;SIM_SOPT0&lt;/STRONG&gt; so that the pin is no longer the reset pin; this is a write once flag and so writes to this register have to be coordinated carefully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full code for KEA128 IRQ and Keyboard interrupts is in the Open Source code link below, including KEA128 simulation for verifying the functionality (example below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26085i007A6960E24AB11B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis KEA128:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTRK-KEA128.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TRK-KEA128.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KEAZ128Q80.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;S32 Design Studio: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2Fcompilers.html%23S32" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/compilers.html#S32&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Free Open Source solution: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FuTasker%2FuTasker-Kinetis" rel="nofollow" target="_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Working project in 15 minutes video: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fyoutu.be%2FK8ScSgpgQ6M" rel="nofollow" target="_blank"&gt;https://youtu.be/K8ScSgpgQ6M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fsupport.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/support.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 01:24:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Need-KEAZ128-external-interrupt-handler-example/m-p/721930#M44232</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-03-02T01:24:23Z</dc:date>
    </item>
  </channel>
</rss>

