<?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 slow down system in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1370185#M61847</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192319"&gt;@Joshua_ZXR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have a couple question regarding your case, I will appreciate if you could answer them.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Can you please explain I little bit more the logic, for my understanding you start the FTM&amp;nbsp; counting (for 5 seconds) after the GPIO rising edge interrupt, am I right? If don’t please explain.&lt;/LI&gt;
&lt;LI&gt;I understand also that this only happens when you are on 2.4MHz or above, so you are not facing this problem below this value? Just to make sure.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Thu, 11 Nov 2021 20:44:36 GMT</pubDate>
    <dc:creator>nxf77486</dc:creator>
    <dc:date>2021-11-11T20:44:36Z</dc:date>
    <item>
      <title>GPIO interrupt slow down system</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1369389#M61841</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Now I am working on FRDM-K64F to implement frequency measurement. I have tried different method ( single edge capture mode, dual edge capture mode, and GPIO interrupt) , b&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;ut all the results are not satisfactory.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;One of my implementation is : &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;use GPIO detect rising edge (PTB9), GPIO IRQ has one action only : &lt;FONT color="#FF0000"&gt;counter&lt;/FONT&gt; plus 1&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;use FTM0 to count time : 5s&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;GPIO interrupt will be disabled&amp;nbsp;once FTM0 5 seconds counting finish&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;according to counter number and timing (5s) to calculate frequency&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;base on my understanding, GPIO use system clock - 120MHz which could response faster interrupt.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;but now I am facing an issue for this implementation. FTM interrupt can not be received once GPIO input signal frequency exceed 2.4MHz.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I think that because GPIO make system busy, so I change GPIO interrupt priority to 2 and set FTM interrupt priority to 1. In my opinion, GPIO interrupt should be preempted by FTM interrupt ( because FTM set to higher frequency). But the result is same as before :&amp;nbsp; FTM interrupt still can not be received once GPIO input signal frequency exceed 2.4MHz.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Then I have set GPIO interrupt to lower frequency -&amp;gt; 256, but the result no different.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;It seems like, whole system has been occupied by GPIO interrupt once the input frequency higher than 2.4MHz, but it doesn't make sense....&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Does anyone can give me a help ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Best Regards&lt;/P&gt;&lt;P&gt;Joshua&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 14:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1369389#M61841</guid>
      <dc:creator>Joshua_ZXR</dc:creator>
      <dc:date>2021-11-10T14:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO interrupt slow down system</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1370185#M61847</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192319"&gt;@Joshua_ZXR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have a couple question regarding your case, I will appreciate if you could answer them.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Can you please explain I little bit more the logic, for my understanding you start the FTM&amp;nbsp; counting (for 5 seconds) after the GPIO rising edge interrupt, am I right? If don’t please explain.&lt;/LI&gt;
&lt;LI&gt;I understand also that this only happens when you are on 2.4MHz or above, so you are not facing this problem below this value? Just to make sure.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 11 Nov 2021 20:44:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1370185#M61847</guid>
      <dc:creator>nxf77486</dc:creator>
      <dc:date>2021-11-11T20:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO interrupt slow down system</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1370350#M61848</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190340"&gt;@nxf77486&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your fast response.&lt;/P&gt;&lt;P&gt;1) yes, FTM counter start&lt;SPAN&gt;&amp;nbsp;after the first GPIO rising edge interrupt. In order to reduce ISR code size, a while loop has been used in the main thread to check counter value&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;GPIO IRQ handler :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;void BOARD_SW_IRQ_HANDLER(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; BOARD_INPUT_SIGNAL_PORT-&amp;gt;ISFR = (1U &amp;lt;&amp;lt; BOARD_INPUT_SIGNAL_PIN);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; //FTM_StartTimer(FTM_BASEADDR, kFTM_SystemClock);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; u32_cnt++;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;main thread start FTM&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;while (0 == u32_cnt)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FTM_StartTimer(FTM_BASEADDR, kFTM_SystemClock);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;is that because GPIO IRQ interrupt too frequent to stuck system in GPIO IRQ handler ? according to this understanding I have tried to start FTM in GPIO IRQ. But it will trigger hard fault ( bus fault) when function " &lt;FONT color="#0000FF"&gt;FTM_StartTimer&amp;nbsp;&lt;/FONT&gt;" be invoked in IRQ handler ...&lt;/P&gt;&lt;P&gt;2) Yes, the implementation working properly when input frequency &amp;lt;= 2.3MHz, and not working when input frequency &amp;gt;= 2.4MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Best Regards&lt;/P&gt;&lt;P&gt;Joshua&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 05:32:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1370350#M61848</guid>
      <dc:creator>Joshua_ZXR</dc:creator>
      <dc:date>2021-11-12T05:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO interrupt slow down system</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1371468#M61859</link>
      <description>&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192319"&gt;@Joshua_ZXR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Ok is good to understand better your application, I would rather suggest to use Callback functions instead of the IRQ Handler for both cases GPIO and FTM, this could help us to optimize.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 19:23:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-interrupt-slow-down-system/m-p/1371468#M61859</guid>
      <dc:creator>nxf77486</dc:creator>
      <dc:date>2021-11-15T19:23:36Z</dc:date>
    </item>
  </channel>
</rss>

