<?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 System clock as FTM source on K64? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839587#M50686</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'm developing on a K64 board under MCUXpresso and I'm trying to get the best resolution for the duty cycle of a&amp;nbsp;PWM I'm generating with one of the FTM. That's why I'm trying to use the fastest clock source possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read from the K64 reference manual that you can use the system clock at 100MHz as the source clock for the module (Chapter 40.1.2, page 976).&lt;/P&gt;&lt;P&gt;However, when using the Peripherals tool from MCUXpresso to configure the FTM, the fastest clock available is the BusClock which is at 50MHz (System Clock with a division factor of 2). I can't get any higher because this clock is limited at 60MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70688iC1AF0EAF47E2F768/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" alt="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FTM3 config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that by looking at the FTM3 registers in Debug Mode and the manual, it seems that I'm selecting the System Clock even though on the peripherals.h generated by the MCUXpresso tools, it is using the Bus Clock at 50MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70787i4B60DC6323D5D07E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" alt="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The register for FTM3 in debug mode after the peripherals are all initialized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70866i65022621B4DB8AE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png" alt="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The K64 manual on Chapter 40.3.3, page 988&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70737i7780E8329029AE7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png" alt="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The code generated by the MCUXpresso tools, on peripherals.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there seems to be an incoherence between the manual and MCUXpresso. And the resolution&amp;nbsp;of duty cycle the 24kHz PWM generated from the timer is around 1000 steps, so it seems like the smallest change on the duty cycle&amp;nbsp;possible is around 25MHz, not even 50MHz!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to manually change the &lt;EM&gt;#define&amp;nbsp;FTM_3_CLOCK_SOURCE&lt;/EM&gt;&amp;nbsp;by replacing&amp;nbsp;&lt;EM&gt;kCLOCK_BusClk&lt;/EM&gt; with &lt;EM&gt;kCLOCK_CoreSysClk&lt;/EM&gt; but it just messes with the PWM frequency, dividing it&amp;nbsp;by a factor of 2 and not giving me a better resolution for the pulse width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A better resolution for the duty cycle of the PWM&amp;nbsp;would really help, so does somebody managed to use the fastest clock available on the MCU for the FTM (or the other peripherals in general)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 09:12:29 GMT</pubDate>
    <dc:creator>leo_thirifays</dc:creator>
    <dc:date>2018-09-18T09:12:29Z</dc:date>
    <item>
      <title>System clock as FTM source on K64?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839587#M50686</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'm developing on a K64 board under MCUXpresso and I'm trying to get the best resolution for the duty cycle of a&amp;nbsp;PWM I'm generating with one of the FTM. That's why I'm trying to use the fastest clock source possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read from the K64 reference manual that you can use the system clock at 100MHz as the source clock for the module (Chapter 40.1.2, page 976).&lt;/P&gt;&lt;P&gt;However, when using the Peripherals tool from MCUXpresso to configure the FTM, the fastest clock available is the BusClock which is at 50MHz (System Clock with a division factor of 2). I can't get any higher because this clock is limited at 60MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70688iC1AF0EAF47E2F768/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" alt="2018-09-18 10_38_33-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FTM3 config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that by looking at the FTM3 registers in Debug Mode and the manual, it seems that I'm selecting the System Clock even though on the peripherals.h generated by the MCUXpresso tools, it is using the Bus Clock at 50MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70787i4B60DC6323D5D07E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" alt="2018-09-18 10_38_04-Combi-Meas - A0630-CB_MCUXpresso_project_source_A0630-CB.c - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The register for FTM3 in debug mode after the peripherals are all initialized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70866i65022621B4DB8AE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png" alt="2018-09-18 10_37_45-K64 manual.pdf - Adobe Acrobat Reader&amp;nbsp;DC.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The K64 manual on Chapter 40.3.3, page 988&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70737i7780E8329029AE7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png" alt="2018-09-18 10_42_01-Combi-Meas - A0630-CB_MCUXpresso_project_board_peripherals.h - MCUXpresso IDE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The code generated by the MCUXpresso tools, on peripherals.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there seems to be an incoherence between the manual and MCUXpresso. And the resolution&amp;nbsp;of duty cycle the 24kHz PWM generated from the timer is around 1000 steps, so it seems like the smallest change on the duty cycle&amp;nbsp;possible is around 25MHz, not even 50MHz!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to manually change the &lt;EM&gt;#define&amp;nbsp;FTM_3_CLOCK_SOURCE&lt;/EM&gt;&amp;nbsp;by replacing&amp;nbsp;&lt;EM&gt;kCLOCK_BusClk&lt;/EM&gt; with &lt;EM&gt;kCLOCK_CoreSysClk&lt;/EM&gt; but it just messes with the PWM frequency, dividing it&amp;nbsp;by a factor of 2 and not giving me a better resolution for the pulse width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A better resolution for the duty cycle of the PWM&amp;nbsp;would really help, so does somebody managed to use the fastest clock available on the MCU for the FTM (or the other peripherals in general)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 09:12:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839587#M50686</guid>
      <dc:creator>leo_thirifays</dc:creator>
      <dc:date>2018-09-18T09:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: System clock as FTM source on K64?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839588#M50687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Léo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Flex timer document is &lt;EM&gt;confusing&lt;/EM&gt; because it talks of using the system clock as one of its clock sources, but if you check the chip configuration you will find that the flex timer's "system clock" is in fact the overall system's &lt;STRONG&gt;bus clock&lt;/STRONG&gt; (true for all Kinetis parts).&lt;/P&gt;&lt;P&gt;This means that the bus clock is indeed the fastest clock that you can use for the Flex Timer.&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;BR /&gt;Kinetis K64:&lt;BR /&gt;&lt;SPAN&gt;- &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%2FFRDM-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &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%2FTWR-K64F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K64F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &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%2FTEENSY_3.5.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_3.5.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &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%2FHexiwear-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/Hexiwear-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;For less questions and faster, cheaper developments: try uTasker for Kinetis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 16:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839588#M50687</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-09-18T16:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: System clock as FTM source on K64?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839589#M50688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the clarification, Mark. That's what I thought.&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;Léo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 07:24:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/System-clock-as-FTM-source-on-K64/m-p/839589#M50688</guid>
      <dc:creator>leo_thirifays</dc:creator>
      <dc:date>2018-09-19T07:24:52Z</dc:date>
    </item>
  </channel>
</rss>

