<?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>Kinetis MicrocontrollersのトピックRe: K64F PWM (Second level period)</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743007#M45258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;The PWM example use Bus clock by default. It was too fast(60MHz) so that you can not achieve second level period.&lt;/P&gt;&lt;P&gt;You need to select Fixed frequency clock(&lt;SPAN style="color: #ff00ff;"&gt;MCGFFCLK&lt;/SPAN&gt;) as the clock source of FTM by FTM0_SC[&lt;STRONG style="color: #ff00ff;"&gt;CLKS&lt;/STRONG&gt;].&lt;/P&gt;&lt;P&gt;And you need to divide down the &lt;SPAN style="color: #ff0000;"&gt;50MHz&lt;/SPAN&gt; external clock to &lt;SPAN style="color: #ff0000;"&gt;32552Hz&lt;/SPAN&gt; by MCG_C1[&lt;STRONG style="color: #3366ff;"&gt;FRDIV&lt;/STRONG&gt;].&lt;/P&gt;&lt;P&gt;If you set FTM0_MOD=65103 and FTMx_SC[PS]=0, the period will be 2 second.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Figure 5-1. Clocking diagram.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50599iC4E46E429938AA06/image-size/large?v=v2&amp;amp;px=999" role="button" title="Figure 5-1. Clocking diagram.png" alt="Figure 5-1. Clocking diagram.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can test the pwm_twochannel example in SDK_2.3.1_FRDM-K64F. You can&amp;nbsp; modify below lines to achieve 1 second period PWM.(I have also attached&amp;nbsp;ftm_pwm_twochannel.c and&amp;nbsp;clock_config.c here. )&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ftm_pwm_twochannel.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50575iD2B995DB025F9D08/image-size/large?v=v2&amp;amp;px=999" role="button" title="ftm_pwm_twochannel.png" alt="ftm_pwm_twochannel.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The FTM_SetupPwm function can only reduce pwmFreq_Hz to 1Hz, and you can not set to 0.5Hz.&lt;/P&gt;&lt;P&gt;So if you want to achieve 2 second period PWM, you may need to modify FTM0_MOD by yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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>Tue, 24 Apr 2018 06:37:00 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2018-04-24T06:37:00Z</dc:date>
    <item>
      <title>K64F PWM (Second level period)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743005#M45256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using K64F and trying to make a PWM with 2 seconds period. Also need to adjust its duty cycle.&lt;/P&gt;&lt;P&gt;The examples in SDK is ns level period FTM PWMs, but I need second level period.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The FTM output compare example can make the 50% duty cycle PWM with second level period, but I am not able change its duty cycle. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:15:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743005#M45256</guid>
      <dc:creator>kevinyuthermo</dc:creator>
      <dc:date>2018-04-18T08:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: K64F PWM (Second level period)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743006#M45257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend that you simply use the fixed frequency input to a FlexTimer module for generating slow PWMs signals since you will probably have less complications with it.&lt;BR /&gt;Attached is a binary for the FRDM-K64F which shows this in operation by generating a 1Hz frequency on PTB18 (J1/1) with 20% mark-space ratio. This is Flex Timer 2 channel 0 clocked from the fixed frequency clock (MCGFFCLK) which is 50MHz oscillator divided by 1024 (48.828kHz). It allows a PWM resolution of 0.002%.&lt;BR /&gt;It also generates a number of 1kHz PWM signals on PTC2, PTC3, PTC4, PTC1, PTD4 and PTD5 form various channels of Flex Timer 0 (at various mark-space ratios), showing that other Flex Timers can use the standard (bus) clock at the same time.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Also the fixed frequency clock input has an optional pre-scaler and so the same accuracy and resolution can also be achieved for frequencies down to 0.06 Hz.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Only for frequencies below say 0.0005Hz would benefit from cascading timers.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Open SDA VCOM has a command line interface at 115200Baud which can be used to view memory and registers in case you need to check any such settings (use the "md" memory display - command in the I/O menu).&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;BR /&gt;&lt;EM&gt;uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 14:56:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743006#M45257</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-04-19T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: K64F PWM (Second level period)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743007#M45258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;The PWM example use Bus clock by default. It was too fast(60MHz) so that you can not achieve second level period.&lt;/P&gt;&lt;P&gt;You need to select Fixed frequency clock(&lt;SPAN style="color: #ff00ff;"&gt;MCGFFCLK&lt;/SPAN&gt;) as the clock source of FTM by FTM0_SC[&lt;STRONG style="color: #ff00ff;"&gt;CLKS&lt;/STRONG&gt;].&lt;/P&gt;&lt;P&gt;And you need to divide down the &lt;SPAN style="color: #ff0000;"&gt;50MHz&lt;/SPAN&gt; external clock to &lt;SPAN style="color: #ff0000;"&gt;32552Hz&lt;/SPAN&gt; by MCG_C1[&lt;STRONG style="color: #3366ff;"&gt;FRDIV&lt;/STRONG&gt;].&lt;/P&gt;&lt;P&gt;If you set FTM0_MOD=65103 and FTMx_SC[PS]=0, the period will be 2 second.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Figure 5-1. Clocking diagram.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50599iC4E46E429938AA06/image-size/large?v=v2&amp;amp;px=999" role="button" title="Figure 5-1. Clocking diagram.png" alt="Figure 5-1. Clocking diagram.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can test the pwm_twochannel example in SDK_2.3.1_FRDM-K64F. You can&amp;nbsp; modify below lines to achieve 1 second period PWM.(I have also attached&amp;nbsp;ftm_pwm_twochannel.c and&amp;nbsp;clock_config.c here. )&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ftm_pwm_twochannel.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50575iD2B995DB025F9D08/image-size/large?v=v2&amp;amp;px=999" role="button" title="ftm_pwm_twochannel.png" alt="ftm_pwm_twochannel.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The FTM_SetupPwm function can only reduce pwmFreq_Hz to 1Hz, and you can not set to 0.5Hz.&lt;/P&gt;&lt;P&gt;So if you want to achieve 2 second period PWM, you may need to modify FTM0_MOD by yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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>Tue, 24 Apr 2018 06:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64F-PWM-Second-level-period/m-p/743007#M45258</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-04-24T06:37:00Z</dc:date>
    </item>
  </channel>
</rss>

