<?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 K22F ramp up frequency slope with FTM in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485963#M29859</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;SPAN lang="EN-US"&gt;hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I am using MK22FN1M0AVLH12, want to create one ramp up frequency slop with FTM as attached picture, its profile is start frequency is1k, end frequency is 8k; step frequency is 200HZ;send out 20 pluse at every frequency step. My goal is that create ramp up frequency slope wave to drivestep motor. My question is that: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Frequency_Slope_.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54300iBC56279145F2CC4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Frequency_Slope_.jpg" alt="Frequency_Slope_.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#1, If can use FTM to realize the ramp up frequency wave as attached picture?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#2, When switch 2 frequency, FTM ouput will stop for a little? Because I am not sure if need to wait a little time after FTM timer settting? Or just when last plus send out at one special frequency, and new set FTM timing set in FTM interrupt ISR, and mcu send out the new special frequency wave after the FTM interrupt ISR?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#3, Do you have the FW about step motor ramp up frequency slope as attached file to share? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Kent&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2016 02:17:34 GMT</pubDate>
    <dc:creator>kent_gu</dc:creator>
    <dc:date>2016-04-28T02:17:34Z</dc:date>
    <item>
      <title>K22F ramp up frequency slope with FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485963#M29859</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;SPAN lang="EN-US"&gt;hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I am using MK22FN1M0AVLH12, want to create one ramp up frequency slop with FTM as attached picture, its profile is start frequency is1k, end frequency is 8k; step frequency is 200HZ;send out 20 pluse at every frequency step. My goal is that create ramp up frequency slope wave to drivestep motor. My question is that: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Frequency_Slope_.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54300iBC56279145F2CC4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Frequency_Slope_.jpg" alt="Frequency_Slope_.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#1, If can use FTM to realize the ramp up frequency wave as attached picture?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#2, When switch 2 frequency, FTM ouput will stop for a little? Because I am not sure if need to wait a little time after FTM timer settting? Or just when last plus send out at one special frequency, and new set FTM timing set in FTM interrupt ISR, and mcu send out the new special frequency wave after the FTM interrupt ISR?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#3, Do you have the FW about step motor ramp up frequency slope as attached file to share? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Kent&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 02:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485963#M29859</guid>
      <dc:creator>kent_gu</dc:creator>
      <dc:date>2016-04-28T02:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: K22F ramp up frequency slope with FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485964#M29860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Kent,&lt;/P&gt;&lt;P&gt;Regarding your question, let me answer it one by one.&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#1, If can use FTM to realize the ramp up frequency wave as attached picture?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&amp;gt;&amp;gt;&amp;gt;First of all, the FTM can&amp;nbsp; implement the ramp up frequency as attached picture. FTM can generate PWM signal with 50% duty cycle. You can enable the FTM Timer Overflow Interrupt by setting "Timer Overflow Interrupt Enable" bit in the FTMx_SC register. in the ISR, you can declare a static or global variable to count the pulse&amp;nbsp; times, when it reach up to the predefined times for example 5, you can change the PWM frequency by decreasing the FTMx_MOD register value and corresponding FTMx_CnV register value, then write the FTMx_PWMLOAD to make the change valid.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Regarding the code, I think you can refer to an5142, which describes how to generate PWM signal, how to change the PWM parameter in the ISR, and it has the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;STRONG&gt;&lt;A class="jive-link-external-small" href="https://community.freescale.com/external-link.jspa?url=http%3A%2F%2Ftinyurl.com%2Fzzbppws" rel="nofollow" target="_blank"&gt;http://tinyurl.com/zzbppws&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#2, When switch 2 frequency, FTM ouput will stop for a little? Because I am not sure if need to wait a little time after FTM timer settting? Or just when last plus send out at one special frequency, and new set FTM timing set in FTM interrupt ISR, and mcu send out the new special frequency wave after the FTM interrupt ISR?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;when switch 2 frequency, the FTM continue to work, you do not need wait for a little time, because the core execute instructions very quickly and the PWM signal is slow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;#3, Do you have the FW about step motor ramp up frequency slope as attached file to share? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;Unfortunately, we have not the code to implement the scheme for stepper motor, as you know, the stepper motor control signal is dependent on the layout of power stage board, controlling method you required.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Hope it can help you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Xiangjun rong&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 03:16:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485964#M29860</guid>
      <dc:creator>xiangjunrong</dc:creator>
      <dc:date>2016-04-29T03:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: K22F ramp up frequency slope with FTM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485965#M29861</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;For best performance you can use a fixed curve in memory representing the ramp as a sequence of frequency values. Using a base timer (such as PIT) you can then transfer the frequency values to the FTM via DMA so that you have a single interrupt at the end of the ramp, confirming that it has completed.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.freescale.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTaskerADC.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerADC.pdf&lt;/A&gt;&lt;SPAN&gt; for general details of generating such waveforms (example in chapter 4 for DAC output and modification for PWM/FTM output in appendix A-c).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Since the FTM's HW controls the changes of the frequencies (using an intermediate buffer to change only on complete cycles) there are no gitches etc.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 11:16:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-ramp-up-frequency-slope-with-FTM/m-p/485965#M29861</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-04-29T11:16:10Z</dc:date>
    </item>
  </channel>
</rss>

