<?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 Re: Kinetis PWM Frequency Changes on Zero Crossing in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927296#M53955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gary,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried to use a common cross zero point detect circuit. The final output is a trigger signal you can connect to your MCU.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92784i462071718818FB51/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2019 14:42:55 GMT</pubDate>
    <dc:creator>FelipeGarcia</dc:creator>
    <dc:date>2019-10-02T14:42:55Z</dc:date>
    <item>
      <title>Kinetis PWM Frequency Changes on Zero Crossing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927295#M53954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently using a PWM output on my MK22FN512 to tone a speaker based upon a measured signal from an antenna. I update the speaker about every 500 msec to 1000 msec and only use 100 Hz to 3000 Hz mapped to signal power (using a log function but that doesn't matter).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On frequency changes, I get a little click and I am sure it is my software "FORCE" update of the PWM registers. I am not a motor control guy but there must be a way to change the frequency just as the sine wave crosses zero for no disruptions. It is not critical for me but would be a nice bug fix before I release the product.&lt;/P&gt;&lt;P&gt;I will dive in to the datasheet but I thought I would reach out to the community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Code:&lt;/P&gt;&lt;P&gt;ftm_chnl_pwm_signal_param_t Speaker_Params;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void SpeakerFreq(unsigned int freq, unsigned int duty)&lt;BR /&gt;{&lt;BR /&gt;Speaker_Params.level = kFTM_LowTrue;&lt;BR /&gt; Speaker_Params.dutyCyclePercent = (duty &amp;amp; 0x3F);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FTM_SetupPwm(FTM0, &amp;amp;Speaker_Params, 1, kFTM_CenterAlignedPwm, freq, SOUND_CLOCK_SOURCE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (speaker_on == false)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Only set level when turning on the speaker&lt;BR /&gt;&amp;nbsp; &amp;nbsp;FTM_UpdateChnlEdgeLevelSelect(FTM0, Speaker_Params.chnlNumber, Speaker_Params.level);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Software trigger to update registers&lt;BR /&gt; FTM_SetSoftwareTrigger(FTM0, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;speaker_on = true;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Sep 2019 12:55:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927295#M53954</guid>
      <dc:creator>gsinde</dc:creator>
      <dc:date>2019-09-29T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis PWM Frequency Changes on Zero Crossing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927296#M53955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gary,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried to use a common cross zero point detect circuit. The final output is a trigger signal you can connect to your MCU.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92784i462071718818FB51/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:42:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927296#M53955</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-10-02T14:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis PWM Frequency Changes on Zero Crossing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927297#M53956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a good idea (if I need to rev my hardware) but unless my final testing shows an issue, the board is ready for production. I would have thought there must be a way in software to arm a PWM frequency change and have it load at an optimal time (which I guessed was zero crossing). I will keep looking at motor control examples just in case. Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 10:35:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-PWM-Frequency-Changes-on-Zero-Crossing/m-p/927297#M53956</guid>
      <dc:creator>gsinde</dc:creator>
      <dc:date>2019-10-03T10:35:34Z</dc:date>
    </item>
  </channel>
</rss>

