<?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: FTM interrupt using API in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245421#M59883</link>
    <description>&lt;P&gt;Just to complete the solution, here the missing code to enable the NVIC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#000000"&gt;    /* enable interrupt */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;    FTM_EnableInterrupts(BOARD_FTM_BASEADDR, kFTM_Chnl0InterruptEnable);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    // enable FTM peripheral IRQ through the NVIC&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    EnableIRQ(FTM0_IRQn);&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;AGA&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 06:53:25 GMT</pubDate>
    <dc:creator>superaga</dc:creator>
    <dc:date>2021-03-15T06:53:25Z</dc:date>
    <item>
      <title>FTM interrupt using API</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245183#M59878</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to configure FTM interrupt on the &lt;EM&gt;MK64FN1M0xxx12&lt;/EM&gt; device using the &lt;EM&gt;SDK_2.x_FRDM-K64F&lt;/EM&gt; API.&lt;/P&gt;&lt;P&gt;I started importing and testing from the SDK the example &lt;EM&gt;frdmk64_ftm_output_compare, &lt;/EM&gt;which works as expected.&lt;/P&gt;&lt;P&gt;I then updated the code &lt;FONT color="#0000FF"&gt;adding the following functions&lt;FONT color="#000000"&gt; to the main file (&lt;EM&gt;ftm_output_compare.c&lt;/EM&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;void FTM0_IRQHandler(void)&lt;/FONT&gt;{&lt;BR /&gt;    uint32_t flags = FTM_GetStatusFlags(BOARD_FTM_BASEADDR);&lt;BR /&gt;    FTM_ClearStatusFlags(BOARD_FTM_BASEADDR, flags);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/*!&lt;BR /&gt;* @brief Main function&lt;BR /&gt;*/&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;    ...&lt;BR /&gt;    ...&lt;BR /&gt;&lt;BR /&gt;    /* Set the timer to be in free-running mode */&lt;BR /&gt;    BOARD_FTM_BASEADDR-&amp;gt;MOD = 0xFFFF;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    /* enable interrupt */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    FTM_EnableInterrupts(BOARD_FTM_BASEADDR, kFTM_Chnl0InterruptEnable);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;    /* Update the buffered registers */&lt;BR /&gt;    FTM_SetSoftwareTrigger(BOARD_FTM_BASEADDR, true);&lt;BR /&gt;&lt;BR /&gt;    FTM_StartTimer(BOARD_FTM_BASEADDR, kFTM_SystemClock);&lt;BR /&gt;    while (1)&lt;BR /&gt;    {&lt;BR /&gt;    };&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I think that this should be enough to trigger the interrupt, but obviously it doesn't since that doesn't work.&lt;/P&gt;&lt;P&gt;Looking to the available peripheral API, I can't find other eventual functions necessary to be called, to enable the desired behavior that is: &lt;STRONG&gt;fire an interrupt every time the timer counter matches the channel value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I really look forward to read some answers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;AGA&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 14:08:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245183#M59878</guid>
      <dc:creator>superaga</dc:creator>
      <dc:date>2021-03-13T14:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: FTM interrupt using API</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245203#M59880</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;For FTM interrupt operation the required interrupt source must be enabled in the timer (or its specific channel, depending on which one is required) and it needs to be enabled in the NVIC.&lt;/P&gt;&lt;P&gt;To make learning and solving the problem easier run the uTasker K64 simulator - free at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt; which gives you a simple interface to use the FTM overflow and channel interrupts or DMA triggering according to its interface described tin &lt;A href="https://www.utasker.com/docs/uTasker/uTaskerHWTimers.pdf" target="_blank"&gt;https://www.utasker.com/docs/uTasker/uTaskerHWTimers.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It allows you to build and run the code on a simulated K64 (where also peripherals are emulated) in order to easily investigate the internal operation and fix any coding errors before final HW verification.&lt;/P&gt;&lt;P&gt;The project can be used to generate compete projects quickly (with TCP/IP, USB, File systems, various peripherals and more) or as a general learning aid. For professionals requiring a future path to the i.MX RT parts projects built with it can run on these with virtually no addition porting effort if and when increased performance is needed..&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;BR /&gt;&lt;FONT color="#999999"&gt;Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements&lt;BR /&gt;&lt;BR /&gt;For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: &lt;A href="https://www.utasker.com/kinetis/FRDM-K64F.html" target="_blank"&gt;https://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 20:19:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245203#M59880</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2021-03-13T20:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: FTM interrupt using API</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245225#M59881</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/1431"&gt;@mjbcswitzerland&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Many thanks for your clear answer.&lt;/P&gt;&lt;P&gt;Yes reading your post I realized that I completely forgot to init the NVIC.&lt;/P&gt;&lt;P&gt;I didn't know about this simulator, looks an amazing tool to run my code, I'll definitely give it a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;AGA&lt;/P&gt;</description>
      <pubDate>Sun, 14 Mar 2021 09:49:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245225#M59881</guid>
      <dc:creator>superaga</dc:creator>
      <dc:date>2021-03-14T09:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: FTM interrupt using API</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245421#M59883</link>
      <description>&lt;P&gt;Just to complete the solution, here the missing code to enable the NVIC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#000000"&gt;    /* enable interrupt */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;    FTM_EnableInterrupts(BOARD_FTM_BASEADDR, kFTM_Chnl0InterruptEnable);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    // enable FTM peripheral IRQ through the NVIC&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;    EnableIRQ(FTM0_IRQn);&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;AGA&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 06:53:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FTM-interrupt-using-API/m-p/1245421#M59883</guid>
      <dc:creator>superaga</dc:creator>
      <dc:date>2021-03-15T06:53:25Z</dc:date>
    </item>
  </channel>
</rss>

