<?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>Processor Expert SoftwareのトピックRe: K64F Edge Aligned PWM with FTM: How to change Duty Cycle?</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406972#M3255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful! Thank you so much. Never in my wildest dreams would I have suspected you had to FTMEN=0 to get it to work without a software trigger. Absolutely excellent write-up and thank you for the sample projects. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Aug 2015 11:23:20 GMT</pubDate>
    <dc:creator>geeksanon</dc:creator>
    <dc:date>2015-08-08T11:23:20Z</dc:date>
    <item>
      <title>K64F Edge Aligned PWM with FTM: How to change Duty Cycle?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406969#M3252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've poured through App Notes and the User Guide to try and figure out how to change the Duty Cycle on Edge Aligned PWM using an FTM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically, I'm trying to use FTM2 with the following PE configuration (non KSDK). A PWM signal with the original CnV values is created. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="FTM2_1.PNG"&gt;&lt;IMG alt="FTM2_1.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/53380i497F11ABB72AB10A/image-size/large?v=v2&amp;amp;px=999" title="FTM2_1.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="FTM2_2.PNG"&gt;&lt;IMG alt="FTM2_2.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/53422i1C67C9E9F49A8CCD/image-size/large?v=v2&amp;amp;px=999" title="FTM2_2.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I said, everything works until I try to change the CnV values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a loop that fires every 100ms, I have the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14386478121014625 jive_macro_code jive_text_macro" data-renderedposition="1100_8_1232_128" jivemacro_uid="_14386478121014625" modifiedtitle="true"&gt;&lt;P&gt;&amp;nbsp; int temp = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; temp = FTM2_C0V;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(temp &amp;lt; 0x4000){&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM2_C0V = temp + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM2_C0V = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the debugger, FTM2_C0V never changes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I have gathered in app notes, PWM Synchronization can only be used in combine mode. This is not what I want. I want CH0 and CH1 to be independent PWM pins. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get CnV to update? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any and all thoughts are appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:17:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406969#M3252</guid>
      <dc:creator>geeksanon</dc:creator>
      <dc:date>2020-11-02T13:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: K64F Edge Aligned PWM with FTM: How to change Duty Cycle?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406970#M3253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello anon, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change the duty at the pwm interrupt function .&lt;/P&gt;&lt;P&gt;And about the PWM configure on PE,&amp;nbsp; you can refer to here :&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2013/03/16/pwm-for-processor-expert-explained/" title="http://mcuoneclipse.com/2013/03/16/pwm-for-processor-expert-explained/"&gt;Tutorial: PWM with Processor Expert | MCU on Eclipse&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And i don't know where you put your this change duty code , please pay attention&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57124iA5E59B0DDD6F32C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 05:27:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406970#M3253</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-08-06T05:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: K64F Edge Aligned PWM with FTM: How to change Duty Cycle?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406971#M3254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The FTM device allows to work in a simple mode (TPM device compatible mode) that allows "legacy" synchronization of CnV and other registers. The synchronization of the FTM device is described in the chapter &lt;EM&gt;40.4.11 PWM synchronization &lt;/EM&gt;in the &lt;EM&gt;K64 Sub-Family Reference Manual, Rev. 2, January 2014 or in application note AN3729 - Using FlexTimer in ACIM/PMSM Motor Control Applications.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;In your case it is important to set the bit FTMEN = 0 (set the &lt;EM&gt;FTM mode &lt;/EM&gt;property to &lt;EM&gt;Disabled) &lt;/EM&gt;and SYNCMODE = 0.&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I have verified this case in a simple demo application on the FRDM-K64F, see the attachment. You can check the signal on the connector J1, pins 1 and 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need the FTM mode enabled (FTMEN = 1) you must use the synchronization, e.g. sw trigger:&lt;/P&gt;&lt;P&gt;- Enable the Software triggering and CnV registers synchronization (SYNCMODE = 1 and SWWRBUF = 1 in FTM2_SYNCONF register).&lt;/P&gt;&lt;P&gt;- Enable Synchronization of Channels 0 and 1 (SYNCEN0 in FTM2_COMBINE).&lt;/P&gt;&lt;P&gt;- Select the loading point - Minimum or Maximum (set the CNTMIN or CNTMAX bit in FTM2_SYNC).&lt;/P&gt;&lt;P&gt;- When you write into any/all CnV register you must set the SWSYNC bit in FTM2_SYNC register (enable trigger).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57266i3406C7390C1DE7AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also created a simple demo application, see the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 12:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406971#M3254</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-08-07T12:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: K64F Edge Aligned PWM with FTM: How to change Duty Cycle?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406972#M3255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful! Thank you so much. Never in my wildest dreams would I have suspected you had to FTMEN=0 to get it to work without a software trigger. Absolutely excellent write-up and thank you for the sample projects. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Aug 2015 11:23:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/K64F-Edge-Aligned-PWM-with-FTM-How-to-change-Duty-Cycle/m-p/406972#M3255</guid>
      <dc:creator>geeksanon</dc:creator>
      <dc:date>2015-08-08T11:23:20Z</dc:date>
    </item>
  </channel>
</rss>

