<?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: GPIO Interrupt on KL25Z works only with internal clock setup in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950955#M54728</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;You can't access PORTx_PCRy registers without them being clocked so a hard-fault in such a case is normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When your interrupt fires you must clear its pending flag by writing to PORTx_ISFR otherwise it will continuously re-enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis GPIO interrupt Video: &lt;A href="https://www.youtube.com/watch?v=CubinvMuTwU" target="test_blank"&gt;https://www.youtube.com/watch?v=CubinvMuTwU&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(also discussing sharing interrupt vectors for unrestricted operation)&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;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Kinetis KL25:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KL25Z.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL25Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/TWR-KL25Z48M.html" target="test_blank"&gt;http://www.utasker.com/kinetis/TWR-KL25Z48M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2019 18:42:04 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2019-07-08T18:42:04Z</dc:date>
    <item>
      <title>GPIO Interrupt on KL25Z works only with internal clock setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950953#M54726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I work with bear metal on the KL25z and I have read the last weak documentation and forum posts&lt;/P&gt;&lt;P&gt;about external Interrupt on the KLZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that the interrupt is only working with the Clock setup to PortA and toggles then the&lt;/P&gt;&lt;P&gt;Interrupt over and over again but it isn't working with an external source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to get an Interrupt if an external signal is incoming but if I comment out the Line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the HardFault Stackframe at the declaration of PORTA_PCR17 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stack frame:&lt;BR /&gt;&amp;nbsp;R0 =&amp;nbsp; 0000031C&lt;BR /&gt;&amp;nbsp;R1 =&amp;nbsp; 40049000&lt;BR /&gt;&amp;nbsp;R2 =&amp;nbsp; E000E100&lt;BR /&gt;&amp;nbsp;R3 =&amp;nbsp; C0000000&lt;BR /&gt;&amp;nbsp;R12 = 00000016&lt;BR /&gt;&amp;nbsp;LR =&amp;nbsp; 80008980&lt;BR /&gt;&amp;nbsp;PC =&amp;nbsp; 0000092E&lt;BR /&gt;&amp;nbsp;PSR = 81000000&lt;BR /&gt;Misc&lt;BR /&gt;&amp;nbsp;LR/EXC_RETURN= FFFFFFF9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(int argc, char* argv[]) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Send a greeting to the trace device (skipped on Release).&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;trace_puts("Hello ARM World!");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;__asm volatile("cpsie i");&amp;nbsp;&amp;nbsp;&amp;nbsp; //Enable Global Interrupts&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;NVIC_SetPriority(PORTA_IRQn, (1UL &amp;lt;&amp;lt; __NVIC_PRIO_BITS) - 1UL); &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PORTA_PCR17&amp;nbsp; |=&amp;nbsp; PORT_PCR_MUX(1)&amp;nbsp; |&amp;nbsp; PORT_PCR_PE_MASK&amp;nbsp; |&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_PCR_PS_MASK | PORT_PCR_IRQC(0x08); // Interrupt on rising and falling edge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;NVIC_EnableIRQ(PORTA_IRQn); //Enable interrupt on IRQN&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (1) {}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern "C" void&lt;BR /&gt;PORTA_IRQHandler() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;trace_puts("1");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace_puts("2");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone can tell me the problem, I have no clue what I do wrong, I read so many docs and&lt;/P&gt;&lt;P&gt;I'm now done with my knowledge....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greedings,&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jul 2019 17:48:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950953#M54726</guid>
      <dc:creator>pokemongoesar</dc:creator>
      <dc:date>2019-07-06T17:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO Interrupt on KL25Z works only with internal clock setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950954#M54727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested different IRQC Options and I found out that '&lt;EM&gt;Interrupt when logic one - 1100&lt;/EM&gt;' &lt;STRONG&gt;&lt;EM&gt;triggers directly&lt;/EM&gt;&lt;/STRONG&gt;, I think the pin might be pulled up internally and the option 'Interrupt when logic zero - 1000'&lt;EM&gt; &lt;STRONG&gt;works only one time &lt;/STRONG&gt;&lt;/EM&gt;after the first time i put in GND to initalize the interrupt it &lt;STRONG&gt;&lt;EM&gt;keeps running forever&lt;/EM&gt;&lt;/STRONG&gt;, even when I plug in 5V it keeps running and vice versa with the logic zero option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried 'NVIC_ClearPendingIRQ(PORTA_IRQn);' in the Interrupt but without any success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did anyone know what I missed in the Interrupt and Pin Setup?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jul 2019 14:26:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950954#M54727</guid>
      <dc:creator>pokemongoesar</dc:creator>
      <dc:date>2019-07-07T14:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO Interrupt on KL25Z works only with internal clock setup</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950955#M54728</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;You can't access PORTx_PCRy registers without them being clocked so a hard-fault in such a case is normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When your interrupt fires you must clear its pending flag by writing to PORTx_ISFR otherwise it will continuously re-enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis GPIO interrupt Video: &lt;A href="https://www.youtube.com/watch?v=CubinvMuTwU" target="test_blank"&gt;https://www.youtube.com/watch?v=CubinvMuTwU&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(also discussing sharing interrupt vectors for unrestricted operation)&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;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Kinetis KL25:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KL25Z.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL25Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/TWR-KL25Z48M.html" target="test_blank"&gt;http://www.utasker.com/kinetis/TWR-KL25Z48M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 18:42:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-Interrupt-on-KL25Z-works-only-with-internal-clock-setup/m-p/950955#M54728</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-07-08T18:42:04Z</dc:date>
    </item>
  </channel>
</rss>

