<?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>CodeWarrior for MCU中的主题 Complementary PWM on FRDM-KL25Z using processor expert</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Complementary-PWM-on-FRDM-KL25Z-using-processor-expert/m-p/343467#M11181</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have got customer queries on unavailability of complementary mode PWM on KL25Z &lt;SPAN aria-label="Sad" class="emoticon_sad emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;. So, I thought let me experiment something and post it onto the community.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The timer module on KL25 is TPM, not FTM!. There are 3 TPMs, TPM0 with 6 channels, TPM1 and TPM2 with 2 channels each. To generate a PWM signal, PWM component can be used. But the PWM bean doesnot provide option to generate complementary PWM. So, we need to configure different channels to get the complementary PWM. Again, there is a limitation for this. PWM component doesn't allow to generate &lt;STRONG&gt;&lt;EM&gt;initial polarity high. &lt;/EM&gt;&lt;/STRONG&gt;It says "the inherited component doesnot support this feature". But in run time can set or clear value on the PWM output pin using the &lt;EM&gt;&lt;STRONG&gt;SetValue() &lt;/STRONG&gt;&lt;/EM&gt;and &lt;EM&gt;&lt;STRONG&gt;ClrValue(). &lt;/STRONG&gt;&lt;/EM&gt;But again the inherited component"&lt;EM&gt;&lt;STRONG&gt;TimerUnit_LDD&lt;/STRONG&gt;&lt;/EM&gt;" doesn't support generating SetValue() and ClrValue()&lt;EM&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So, I came to a conclusion '&lt;EM&gt;&lt;STRONG&gt;not to use PWM component&lt;/STRONG&gt;&lt;/EM&gt;' and started using &lt;EM&gt;&lt;STRONG&gt;Init_TPM. &lt;/STRONG&gt;&lt;/EM&gt;Using this component, 2 channels are configured to have opposite polarity during initialization. They are configured to have the same period. Deadtime is also inserted by configuring different duty cycle on each channel. But methods are not available since the component only provides the initialization function which is good enough to start &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;. Dynamically if dutycycle needs to be changed, methods have to be written explicitly &lt;SPAN aria-label="Sad" class="emoticon_sad emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Project and oscilloscope captures are attached for reference.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18631_18631.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120130i0A0092DE8F6DBA03/image-size/large?v=v2&amp;amp;px=999" role="button" title="18631_18631.bmp" alt="18631_18631.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tek00001.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46856iBEF0DAE503A6DABC/image-size/large?v=v2&amp;amp;px=999" role="button" title="tek00001.bmp" alt="tek00001.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18632_18632.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120131i402AB1710D253C4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="18632_18632.bmp" alt="18632_18632.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tek00002.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46054iA065D0F2C4701B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="tek00002.bmp" alt="tek00002.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339235"&gt;kl25_test.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 11:06:40 GMT</pubDate>
    <dc:creator>pramodtm-b46240</dc:creator>
    <dc:date>2015-01-14T11:06:40Z</dc:date>
    <item>
      <title>Complementary PWM on FRDM-KL25Z using processor expert</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Complementary-PWM-on-FRDM-KL25Z-using-processor-expert/m-p/343467#M11181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have got customer queries on unavailability of complementary mode PWM on KL25Z &lt;SPAN aria-label="Sad" class="emoticon_sad emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;. So, I thought let me experiment something and post it onto the community.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The timer module on KL25 is TPM, not FTM!. There are 3 TPMs, TPM0 with 6 channels, TPM1 and TPM2 with 2 channels each. To generate a PWM signal, PWM component can be used. But the PWM bean doesnot provide option to generate complementary PWM. So, we need to configure different channels to get the complementary PWM. Again, there is a limitation for this. PWM component doesn't allow to generate &lt;STRONG&gt;&lt;EM&gt;initial polarity high. &lt;/EM&gt;&lt;/STRONG&gt;It says "the inherited component doesnot support this feature". But in run time can set or clear value on the PWM output pin using the &lt;EM&gt;&lt;STRONG&gt;SetValue() &lt;/STRONG&gt;&lt;/EM&gt;and &lt;EM&gt;&lt;STRONG&gt;ClrValue(). &lt;/STRONG&gt;&lt;/EM&gt;But again the inherited component"&lt;EM&gt;&lt;STRONG&gt;TimerUnit_LDD&lt;/STRONG&gt;&lt;/EM&gt;" doesn't support generating SetValue() and ClrValue()&lt;EM&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So, I came to a conclusion '&lt;EM&gt;&lt;STRONG&gt;not to use PWM component&lt;/STRONG&gt;&lt;/EM&gt;' and started using &lt;EM&gt;&lt;STRONG&gt;Init_TPM. &lt;/STRONG&gt;&lt;/EM&gt;Using this component, 2 channels are configured to have opposite polarity during initialization. They are configured to have the same period. Deadtime is also inserted by configuring different duty cycle on each channel. But methods are not available since the component only provides the initialization function which is good enough to start &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;. Dynamically if dutycycle needs to be changed, methods have to be written explicitly &lt;SPAN aria-label="Sad" class="emoticon_sad emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Project and oscilloscope captures are attached for reference.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18631_18631.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120130i0A0092DE8F6DBA03/image-size/large?v=v2&amp;amp;px=999" role="button" title="18631_18631.bmp" alt="18631_18631.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tek00001.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46856iBEF0DAE503A6DABC/image-size/large?v=v2&amp;amp;px=999" role="button" title="tek00001.bmp" alt="tek00001.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18632_18632.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120131i402AB1710D253C4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="18632_18632.bmp" alt="18632_18632.bmp" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tek00002.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46054iA065D0F2C4701B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="tek00002.bmp" alt="tek00002.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339235"&gt;kl25_test.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:06:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Complementary-PWM-on-FRDM-KL25Z-using-processor-expert/m-p/343467#M11181</guid>
      <dc:creator>pramodtm-b46240</dc:creator>
      <dc:date>2015-01-14T11:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Complementary PWM on FRDM-KL25Z using processor expert</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Complementary-PWM-on-FRDM-KL25Z-using-processor-expert/m-p/343468#M11182</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;Note that this is also supported in the uTasker project - see &lt;A href="http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF" title="http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF"&gt;http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;See specifically the final page - this is compatible for K and KL processors.&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:33:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Complementary-PWM-on-FRDM-KL25Z-using-processor-expert/m-p/343468#M11182</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-14T17:33:48Z</dc:date>
    </item>
  </channel>
</rss>

