<?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: Problem with signal multiplexing FTM0 CH2 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-signal-multiplexing-FTM0-CH2/m-p/457338#M27271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a solution but not an explanation.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I set the FTMEN bit in the MODE register, then all FTM channels are available as PWM signals. Since I was not using any advanced FTM functions, I assumed TPM compatibility (FTMEN=0) would be OK.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, without FTMEN set there are strange effects on certain other FTM channels.&amp;nbsp; For example, FTM0 CH0 has glitches in the PWM output.&amp;nbsp; These go away when FTMEN=1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using TPM legacy mode on other Kinetis devices for more than 1 year with this same motor control code.&amp;nbsp; I wonder if something changed in the latest silicon revision for this part?&amp;nbsp; It sure looks like silicon issue.&amp;nbsp; Moving on with my work-around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Nov 2015 18:53:00 GMT</pubDate>
    <dc:creator>rev</dc:creator>
    <dc:date>2015-11-05T18:53:00Z</dc:date>
    <item>
      <title>Problem with signal multiplexing FTM0 CH2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-signal-multiplexing-FTM0-CH2/m-p/457337#M27270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble with the pin signal multiplexing for FTM0 CH2 on a MK22FX512AVLL device. My board uses a lot of FTM channels for PWM functions and I'm able to successfully route all other FTM signals to pins.&amp;nbsp; For some reason FTM0 CH2 is problematic.&amp;nbsp; Regardless of the PORT settings, the output pin remains floating (undriven) by the FTM channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple test case is below.&amp;nbsp; This code works for other FTM channels, but not for FTM0 CH2.&amp;nbsp; I've tried routing to PTA5, PTC3 and PTC5 with similar results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14467421365002917" data-renderedposition="113_8_1232_16" jivemacro_uid="_14467421365002917"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;// Set up Timer 0 for simple edge-aligned PWM&lt;/P&gt;&lt;P&gt;// Enable the Clock to the FTM0 Module&lt;/P&gt;&lt;P&gt;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_FTM0_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Route FTM0_CH2 to PTA5,&lt;/P&gt;&lt;P&gt;PORTA-&amp;gt;PCR[5] = PORT_PCR_MUX(3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Disable FTM write protection&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;MODE |= FTM_MODE_WPDIS_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//FTM Counter Value - reset counter to zero&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;CNT = 0x0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set modulo count&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;MOD = sysclk / (8 * FTM0_PWM_FREQUENCY);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Set the Counter Initial Value to 0&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;CNTIN = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Configure for edge aligned PWM&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;CONTROLS[1].CnSC = (FTM_CnSC_ELSB_MASK | FTM_CnSC_MSB_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set PWM to ~50%&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;CONTROLS[1].CnV = 500;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set clock prescaler to SYSCLK divided by 2&lt;/P&gt;&lt;P&gt;FTM0-&amp;gt;SC =&amp;nbsp; FTM_SC_CLKS(1) | FTM_SC_PS(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while (1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 16:51:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-signal-multiplexing-FTM0-CH2/m-p/457337#M27270</guid>
      <dc:creator>rev</dc:creator>
      <dc:date>2015-11-05T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with signal multiplexing FTM0 CH2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-signal-multiplexing-FTM0-CH2/m-p/457338#M27271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a solution but not an explanation.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I set the FTMEN bit in the MODE register, then all FTM channels are available as PWM signals. Since I was not using any advanced FTM functions, I assumed TPM compatibility (FTMEN=0) would be OK.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, without FTMEN set there are strange effects on certain other FTM channels.&amp;nbsp; For example, FTM0 CH0 has glitches in the PWM output.&amp;nbsp; These go away when FTMEN=1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using TPM legacy mode on other Kinetis devices for more than 1 year with this same motor control code.&amp;nbsp; I wonder if something changed in the latest silicon revision for this part?&amp;nbsp; It sure looks like silicon issue.&amp;nbsp; Moving on with my work-around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 18:53:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-signal-multiplexing-FTM0-CH2/m-p/457338#M27271</guid>
      <dc:creator>rev</dc:creator>
      <dc:date>2015-11-05T18:53:00Z</dc:date>
    </item>
  </channel>
</rss>

