<?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: How do I setup a flextimer overflow interrupt function? in Vybrid Processors</title>
    <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401493#M4342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you clarify please, is this under Linux, or MQX? If MQX, I apologize, but we are only able to support Linux Vybrid issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Timesys Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 19:55:27 GMT</pubDate>
    <dc:creator>timesyssupport</dc:creator>
    <dc:date>2015-05-21T19:55:27Z</dc:date>
    <item>
      <title>How do I setup a flextimer overflow interrupt function?</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401491#M4340</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;I have a question regarding setting up an interrupt function to be called when a FlexTimer overflow occurs.&amp;nbsp; I want to use the FlexTimer 0 to call the Flex0_ISR function everytime the timer overflows, but the interrupt function is not being called.&amp;nbsp; From what I can tell, the timer is running, as I see CNT register increasing, and I believe the interrupt should be firing at the FlexTimer level (SC-&amp;gt;TOF and SC-&amp;gt;TOIE are both set to 1).&amp;nbsp; I am sure I am overlooking something or enabling the incorrect interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is code I am using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Interrupt function prototype&lt;/P&gt;&lt;P&gt;static void&amp;nbsp;&amp;nbsp;&amp;nbsp; Flex0_ISR (pointer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void cmsis_task(uint_32 node_num)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; _mqx_uint mqxIntReturn;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; //Setup the interrupt&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; _int_install_isr(NVIC_FlexTimer0, Flex0_ISR, NULL);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; mqxIntReturn =&amp;nbsp; _bsp_int_init(NVIC_FlexTimer0, 7, 0, TRUE);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; //Enable the clock to the FlexTimer 0&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; CCM_CCGR1 |= CCM_CCGR1_CG8(0x3); //FTM0 clock is on during all modes, except stop mode (0x03)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; CCM_CSCMR2 = (CCM_CSCMR2 &amp;amp; CCM_CSCMR2_FTM0_EXT_CLK_SEL_MASK) | CCM_CSCMR2_FTM0_EXT_CLK_SEL(2);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; CCM_CSCDR1 |= CCM_CSCDR1_FTM0_CLK_EN_MASK;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; //Setup FlexTimer 0&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; FTM0_MOD = 83;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; FTM0_CNT = 0x0; //Reset counter to zero&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; FTM0_CNTIN = 0; //Set the Counter Initial Value to 0&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; //Set FTM 0 Clock Source to System Clock, and Prescaler to / 1&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; FTM0_SC = FTM_SC_CLKS(1) | FTM_SC_PS(0) | FTM_SC_TOIE_MASK;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; //Ensure the M4 can access the FlexTimer 0 interrupt&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; MSCM_BASE_PTR-&amp;gt;IRSPRC42 = 0x03;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int doFlexOnce = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Interrupt function&lt;/P&gt;&lt;P&gt;static void Flex0_ISR(pointer parameter)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; if(doFlexOnce == 0)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; {&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp; doFlexOnce++;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 16:01:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401491#M4340</guid>
      <dc:creator>DanKSI</dc:creator>
      <dc:date>2015-05-05T16:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a flextimer overflow interrupt function?</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401492#M4341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/timesyssupport"&gt;timesyssupport&lt;/A&gt;​ can you help here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 17:15:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401492#M4341</guid>
      <dc:creator>karina_valencia</dc:creator>
      <dc:date>2015-05-11T17:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a flextimer overflow interrupt function?</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401493#M4342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you clarify please, is this under Linux, or MQX? If MQX, I apologize, but we are only able to support Linux Vybrid issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Timesys Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 19:55:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401493#M4342</guid>
      <dc:creator>timesyssupport</dc:creator>
      <dc:date>2015-05-21T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a flextimer overflow interrupt function?</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401494#M4343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am finally getting back to this.&amp;nbsp; I am trying to set this up using MQX on the M4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to have some specific timings to control some external hardware and if MQX gets in the way too much, I may need to switch to a bare metal approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:54:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401494#M4343</guid>
      <dc:creator>DanKSI</dc:creator>
      <dc:date>2015-08-17T13:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a flextimer overflow interrupt function?</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401495#M4344</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;I was able to get the ISR function call working by changing the interrupt priority from 7 to 3 in the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;_bsp_int_init function call.&amp;nbsp; I added some code to clear the TOF bit in the FTM_SC register when inside the ISR function and it now functions as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2015 20:38:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/How-do-I-setup-a-flextimer-overflow-interrupt-function/m-p/401495#M4344</guid>
      <dc:creator>DanKSI</dc:creator>
      <dc:date>2015-09-01T20:38:53Z</dc:date>
    </item>
  </channel>
</rss>

