<?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: Disabling FTM in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456757#M27232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elizabeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you set the pin MUX it will 'immediately' set the pin to the idle state (the PWM will stil be running but not affecting the pin anymore).&lt;/P&gt;&lt;P&gt;In fact if you stop it to go to a sleep mode that automatically disables the FTM you don't even need to do anything else since it will freeze the PWM anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whe exiting sleep mode you just need to set the MUX back to FTM and it will continue from where it left off....&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2015 02:06:39 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2015-09-18T02:06:39Z</dc:date>
    <item>
      <title>Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456753#M27228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using one of the FTM timers in a K60 as a PWM signal to control the dimming of the backlighting on a display. It all works correctly but I am confused about the optimal way to disable the FTM and guarantee that the output of the FTM is low before entering one of the K60 sleep modes. I have tried a number of approaches&amp;nbsp; but haven't come up with an optimal solution that works every time before sleep mode is entered. I hate to just throw in arbitrary delays without understanding the underlying considerations. I was hoping that stopping the clock and setting the initialization bit would work but it doesn't work reliably.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Stop the clock&lt;/P&gt;&lt;P&gt;FTM0_SC = (FTM_SC_CLKS(0x00) | FTM_SC_PS(0x00));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set output initialization to be low&lt;/P&gt;&lt;P&gt;FTM0_OUTINIT &amp;amp;= ~FTM_OUTINIT_CH2OI_MASK;&lt;/P&gt;&lt;P&gt;// Force initialization&lt;/P&gt;&lt;P&gt;FTM0_MODE = FTM_MODE_FAULT(0x00) | FTM_MODE_WPDIS_MASK | FTM_MODE_INIT_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried resetting the count and setting the offset register to equal the period and using the SYNC register to force the buffer values to the registers but that didn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any help on this!&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;Elizabeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 21:14:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456753#M27228</guid>
      <dc:creator>ERussell</dc:creator>
      <dc:date>2015-09-16T21:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456754#M27229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elizabeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would change the pin MUX to GPIO (which is set to the inactive output state that you want).&lt;/P&gt;&lt;P&gt;Then disable the PWM operation (and optionally disable the clock to the FTM).&lt;/P&gt;&lt;P&gt;Then enter sleep mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will immediately disable the output to its OFF state, freeze the PWM count and sleep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On wake up you could easily continue from the frozen state by doing the reverse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transition will be (approx.) immediate.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2015 00:54:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456754#M27229</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-09-17T00:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456755#M27230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elizabeth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure how you implement your application, and which mode you put the FTM in, but generally the FTM will generate an interrupt when channel (n) match event happens, you may put the disable code in the ISR providing the time from channel (n) match to timer overflow is enough to run the ISR code.BTW, you may try FTMx_OUTMASK register if the inactive state is low in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Freescale Technical Support&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2015 07:30:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456755#M27230</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2015-09-17T07:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456756#M27231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to both of you who replied. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I also tried changing the pin MUX to GPIO, but after&amp;nbsp; stopping the FTM clock rather than before. Neither way worked without delays.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I am not using the interrupt capability in the FTM. Using the OUTMASK register I would assume would also need a delay since it is buffered.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I have come up with a workable solution by setting the offset ticks equal to the period, waiting for 20 msec, and then stopping the clock. I don't know whether 20 msec is optimal, but I do know that 2 msec wasn't enough. I still don't know why setting the init bit in the MODE register doesn't work - but maybe that too requires a delay.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Thanks again,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Elizabeth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2015 19:22:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456756#M27231</guid>
      <dc:creator>ERussell</dc:creator>
      <dc:date>2015-09-17T19:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456757#M27232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elizabeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you set the pin MUX it will 'immediately' set the pin to the idle state (the PWM will stil be running but not affecting the pin anymore).&lt;/P&gt;&lt;P&gt;In fact if you stop it to go to a sleep mode that automatically disables the FTM you don't even need to do anything else since it will freeze the PWM anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whe exiting sleep mode you just need to set the MUX back to FTM and it will continue from where it left off....&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2015 02:06:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456757#M27232</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-09-18T02:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456758#M27233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,Elizabath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you set the FTM_SC_CLKS(0x00), the FTM_CHx pin will be in high impedance, in the case, you have to connect a 5K~10K ohm pull-down resistor so that the FTM_CHx pin is in low logic.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2015 09:15:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456758#M27233</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2015-09-18T09:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456759#M27234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I think I am better understanding the issue. I do have an external pulldown on the pin - but the value is 200k - not what I would normally choose but that was the value recommended by the backlight driver manufacturer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I just enabled the internal pulldown on the pin (which reduces the effective resistance) and now both the solution suggested by Mark and XiangJun work correctly without added delays which was what I was wanting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Elizabeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2015 17:57:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Disabling-FTM/m-p/456759#M27234</guid>
      <dc:creator>ERussell</dc:creator>
      <dc:date>2015-09-18T17:57:11Z</dc:date>
    </item>
  </channel>
</rss>

