<?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: KE04 FTM0 C0V, C1V update problem in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1221400#M59445</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/48295"&gt;@jaroslavbrazdil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not seen in your code if you already enabled the&amp;nbsp; FTM IRQ in the NVIC. Could you try to call the following function before the FTM starts to run?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;NVIC_EnableIRQ( IRQn_Type interrupt );&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet, the FRDM-KE04Z does not have examples for the&amp;nbsp; FTM. However for a reference you could check the&amp;nbsp;FRDM-KE06Z SDK FTM examples.&amp;nbsp; Its examples use the FTM SDK drivers.&lt;/P&gt;
&lt;P&gt;The FTM is common along Kinetis MCUs. There is an application note regarding the FTM with bare metal code examples. It may help you as an additional reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN5142.pdf" target="_self"&gt;Features of the FlexTimer Module&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 18:44:28 GMT</pubDate>
    <dc:creator>diego_charles</dc:creator>
    <dc:date>2021-01-26T18:44:28Z</dc:date>
    <item>
      <title>KE04 FTM0 C0V, C1V update problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1219592#M59410</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with update (or set) the FTM0_C0V or FTM0_C1V register. I can use FTM2 with no problem.&lt;/P&gt;&lt;P&gt;I know that FTM0 is more simple than FTM2.&lt;/P&gt;&lt;P&gt;Here is my Init function:&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;void FTM0_Init(void){&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* ReSet the CLKS */ &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;SC = 0; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Set the PWM period */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;MOD = 0x0FFF0;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Set the channel values Output Capture Mode*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;CONTROLS[0].CnSC = FTM_CnSC_ELSA_MASK | FTM_CnSC_CHIE_MASK; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;CONTROLS[1].CnSC = FTM_CnSC_ELSA_MASK | FTM_CnSC_CHIE_MASK; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Set the C0V and C1V */ &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;CONTROLS[0].CnV = 0x08F8;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;CONTROLS[1].CnV = 0x0800;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Set CLKS*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FTM0-&amp;gt;SC = FTM_SC_CLKS(1) | FTM_SC_PS(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The CnSC registers are updated OK, The counter is counting but I cant set the CnV registers.&lt;/P&gt;&lt;P&gt;The CLKS is 0:0, but CnV is not changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to change CnV repeatedly in loop too. No change.&lt;/P&gt;&lt;P&gt;Can somebody help me please?&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;Jaroslav&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 11:35:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1219592#M59410</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2021-01-22T11:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: KE04 FTM0 C0V, C1V update problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1219670#M59411</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I have found something new.&lt;/P&gt;&lt;P&gt;I can change FTM0_C0V or FTM_C1V when I set FTM0_SC =&amp;nbsp;FTM_SC_CPWMS_MASK;&lt;/P&gt;&lt;P&gt;Then CnV is set, but the FTM0_C0SC bit CHF is not set when CNT is running. I cant get an interrupt.&lt;/P&gt;&lt;P&gt;TOF interrupt is working OK.&lt;/P&gt;&lt;P&gt;CNT value is changing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea what is going here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;Jaroslav&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:33:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1219670#M59411</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2021-01-22T14:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: KE04 FTM0 C0V, C1V update problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1221400#M59445</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/48295"&gt;@jaroslavbrazdil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not seen in your code if you already enabled the&amp;nbsp; FTM IRQ in the NVIC. Could you try to call the following function before the FTM starts to run?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;NVIC_EnableIRQ( IRQn_Type interrupt );&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet, the FRDM-KE04Z does not have examples for the&amp;nbsp; FTM. However for a reference you could check the&amp;nbsp;FRDM-KE06Z SDK FTM examples.&amp;nbsp; Its examples use the FTM SDK drivers.&lt;/P&gt;
&lt;P&gt;The FTM is common along Kinetis MCUs. There is an application note regarding the FTM with bare metal code examples. It may help you as an additional reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN5142.pdf" target="_self"&gt;Features of the FlexTimer Module&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 18:44:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04-FTM0-C0V-C1V-update-problem/m-p/1221400#M59445</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2021-01-26T18:44:28Z</dc:date>
    </item>
  </channel>
</rss>

