<?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: How to generate 0 to 20kHz square wave with FTM?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607620#M35844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Mark! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was exactly the kind of advice I was looking for. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I had considered a "PIT+ISR" solution, but did not like the idea of generating so many interrupts (especially at higher frequencies). &amp;nbsp;Your DMA idea is a very nice alternative, and a clever use of the hardware. &amp;nbsp;I'll give it a try.&lt;/P&gt;&lt;P&gt;Thank you so much for your prompt reply and good idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Nov 2016 18:31:20 GMT</pubDate>
    <dc:creator>cfgmgr</dc:creator>
    <dc:date>2016-11-21T18:31:20Z</dc:date>
    <item>
      <title>How to generate 0 to 20kHz square wave with FTM?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607618#M35842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using a K60 (bare metal board), I am looking for a good way to generate a simple 50% duty cycle square wave on an output pin at a rate from 0Hz to approx 20kHz, with (hopefully) 1Hz resolution or better. &amp;nbsp;In essence, I'd like to create a function generator that can sweep from 0 to 20KHz. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have experimented with examples of using EPWM mode, and I can see how to use the FTM0 module for varying pulse widths and frequencies, but the problem I am having is how best to do this at low frequencies (i.e. &amp;lt; 9Hz). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming that with my system clock at 75Mhz, my lowest frequency achievable FTM frequency is (75Mhz / 128 / 65535) or about 8.9Hz? &amp;nbsp;If so, what is the best way to control the channel outputs below 9Hz? &amp;nbsp;Can this be done elegantly in hardware with just an FTM? &amp;nbsp;Or do I need a combination of periodic timer + ISR code? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers would be greatly appreciated! &amp;nbsp;Thanks,&lt;/P&gt;&lt;P&gt;-Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 16:09:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607618#M35842</guid>
      <dc:creator>cfgmgr</dc:creator>
      <dc:date>2016-11-21T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 0 to 20kHz square wave with FTM?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607619#M35843</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;The problem with the FTM (in this case) is that it has 16 bit counters (with limited pre-scaling) so slow frequencies are troublesome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would look at using a PIT instead since, even when clocked by a 60MHz bus clock, frequencies less that 0.01Hz can be generated (and up to 30MHz).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PIT IRQ would probably be OK for your range but (much) higher accuracy and (much) lower jitter can be achieved by triggering a DMA transfer on each PIT match to write to a port toggle register (this generating a square wave).&lt;/P&gt;&lt;P&gt;Furthermore, the same DMA trigger can(/could) be used to load a new timer value to achieve smooth sweeps (or programmable sweeps that are controlled purely by HW, based on a sweep curve).&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;SPAN&gt;Kinetis for professionals: &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;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:20:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607619#M35843</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-11-21T18:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 0 to 20kHz square wave with FTM?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607620#M35844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Mark! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was exactly the kind of advice I was looking for. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I had considered a "PIT+ISR" solution, but did not like the idea of generating so many interrupts (especially at higher frequencies). &amp;nbsp;Your DMA idea is a very nice alternative, and a clever use of the hardware. &amp;nbsp;I'll give it a try.&lt;/P&gt;&lt;P&gt;Thank you so much for your prompt reply and good idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:31:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-generate-0-to-20kHz-square-wave-with-FTM/m-p/607620#M35844</guid>
      <dc:creator>cfgmgr</dc:creator>
      <dc:date>2016-11-21T18:31:20Z</dc:date>
    </item>
  </channel>
</rss>

