<?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 K32L2B21: generate PWM with variable frequency in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/K32L2B21-generate-PWM-with-variable-frequency/m-p/1283394#M4171</link>
    <description>&lt;P&gt;Hello, I need to generate a sound with a variable frequency during time (a siren).&lt;/P&gt;&lt;P&gt;I'm using uC K32L2B21, library&amp;nbsp;SDK_2.9.0_K32L2B21xxxxA, MCUxpresso config tools v9,&amp;nbsp; and TPM as a HW resource.&lt;BR /&gt;But I didn't find a way to dynamically change the frequency of a timer in a TPM library.&lt;BR /&gt;Pulse-Frequency-Modulation seems not supported on this chip.&lt;BR /&gt;I found only one timer API function that can be used for frequency changing (TPM_SetupPwm), but it entails constant period. What is the best way to generate variable frequency PWM?&lt;BR /&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 10:26:13 GMT</pubDate>
    <dc:creator>nre</dc:creator>
    <dc:date>2021-05-27T10:26:13Z</dc:date>
    <item>
      <title>K32L2B21: generate PWM with variable frequency</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/K32L2B21-generate-PWM-with-variable-frequency/m-p/1283394#M4171</link>
      <description>&lt;P&gt;Hello, I need to generate a sound with a variable frequency during time (a siren).&lt;/P&gt;&lt;P&gt;I'm using uC K32L2B21, library&amp;nbsp;SDK_2.9.0_K32L2B21xxxxA, MCUxpresso config tools v9,&amp;nbsp; and TPM as a HW resource.&lt;BR /&gt;But I didn't find a way to dynamically change the frequency of a timer in a TPM library.&lt;BR /&gt;Pulse-Frequency-Modulation seems not supported on this chip.&lt;BR /&gt;I found only one timer API function that can be used for frequency changing (TPM_SetupPwm), but it entails constant period. What is the best way to generate variable frequency PWM?&lt;BR /&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 10:26:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/K32L2B21-generate-PWM-with-variable-frequency/m-p/1283394#M4171</guid>
      <dc:creator>nre</dc:creator>
      <dc:date>2021-05-27T10:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: K32L2B21: generate PWM with variable frequency</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/K32L2B21-generate-PWM-with-variable-frequency/m-p/1284109#M4173</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/186001"&gt;@nre&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;There is a inline function in fsl_tpm.h&lt;/P&gt;
&lt;P&gt;static inline void TPM_SetTimerPeriod(TPM_Type *base, uint32_t ticks)&lt;BR /&gt;{&lt;BR /&gt;base-&amp;gt;MOD = ticks;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 10:39:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/K32L2B21-generate-PWM-with-variable-frequency/m-p/1284109#M4173</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2021-05-28T10:39:22Z</dc:date>
    </item>
  </channel>
</rss>

