<?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: iMX8MM, Cortex-M4, PWM: calculate the clock frequency in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698088#M210159</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;According to the SDK reference manual the PWM clock sources could be:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jorge7u7_0-1691022452093.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234835iED6065F8F61836E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jorge7u7_0-1691022452093.png" alt="Jorge7u7_0-1691022452093.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 00:27:44 GMT</pubDate>
    <dc:creator>JorgeCas</dc:creator>
    <dc:date>2023-08-03T00:27:44Z</dc:date>
    <item>
      <title>iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1696012#M209970</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I want to calculate the PWM clock frequency by Cortex-M4. Current setup is with SDK default values which is 32kHz clock frequency which I also verified by measurement.&lt;BR /&gt;&lt;BR /&gt;I read out the PWM clock frequency with&lt;/P&gt;&lt;LI-CODE lang="c"&gt;CLOCK_GetClockRootFreq(kCLOCK_Pwm1ClkRoot)&lt;/LI-CODE&gt;&lt;P&gt;which gives me 24MHz. This function also seems to take the pre/post dividers into account. Now I'm a bit confused because according to the clock tree figure on reference manual rev.3, page 315 there's no 32k clock source which can be assigned to PWM blocks by multiplexer.&lt;BR /&gt;&lt;BR /&gt;What is the correct procedure to calculate the clock frequency with SDK functions?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 15:06:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1696012#M209970</guid>
      <dc:creator>Raal</dc:creator>
      <dc:date>2023-07-31T15:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1696948#M210065</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The clock source for PWM can be configured with kPWM_LowFrequencyClock that corresponds to 32.768 KHz.&lt;/P&gt;
&lt;P&gt;But it seems that the function is returning the value of the bus clock.&lt;/P&gt;
&lt;P&gt;I suggest you check the value of struct pwm_config_t on clockSource to check the clock source for the counter.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 20:07:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1696948#M210065</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-08-01T20:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1697173#M210092</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203308"&gt;@JorgeCas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;okay, I'll check the PWM configuration. But how is the relation between clock tree and the clock source from PWM configuration register? It looks like the PWM clock mechanism works "around" the clock tree?&lt;BR /&gt;&lt;BR /&gt;So, ClkSrc = 0x03 uses a dedicated 32.768 Hz clock which is not part of the clock tree? And 0x01/0x02 are sourced from clock tree?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 04:33:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1697173#M210092</guid>
      <dc:creator>Raal</dc:creator>
      <dc:date>2023-08-02T04:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698088#M210159</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;According to the SDK reference manual the PWM clock sources could be:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jorge7u7_0-1691022452093.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234835iED6065F8F61836E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jorge7u7_0-1691022452093.png" alt="Jorge7u7_0-1691022452093.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 00:27:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698088#M210159</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-08-03T00:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698254#M210180</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203308"&gt;@JorgeCas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;this is interesting - my SDK manual shows the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Raal_0-1691038264487.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234881i385B2D18C4ABA1E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Raal_0-1691038264487.png" alt="Raal_0-1691038264487.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Raal_1-1691038280588.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234882iC4929A5415BFF963/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Raal_1-1691038280588.png" alt="Raal_1-1691038280588.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This also fits to the device reference manual:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Raal_2-1691038364124.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234883i3B4E0D5EF03D74B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Raal_2-1691038364124.png" alt="Raal_2-1691038364124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Your SDK information doesn't mention the 32kHz frequency? Which SDK version are you using?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 04:55:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698254#M210180</guid>
      <dc:creator>Raal</dc:creator>
      <dc:date>2023-08-03T04:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698850#M210247</link>
      <description>&lt;P&gt;Got it, I was using &lt;A href="https://mcuxpresso.nxp.com/api_doc/dev/2308/a00050.html#ga54dcbb5e3e5c8ceebef5f46a9ec73a2f" target="_self"&gt;this&lt;/A&gt; as reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it is better to use &lt;A href="https://mcuxpresso.nxp.com/api_doc/dev/3866/a00119.html#ga54dcbb5e3e5c8ceebef5f46a9ec73a2f" target="_self"&gt;this reference manual&lt;/A&gt; (2.14), this information matches to this case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jorge7u7_0-1691089463806.png" style="width: 506px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234996i30D683792488E86D/image-dimensions/506x110?v=v2" width="506" height="110" role="button" title="Jorge7u7_0-1691089463806.png" alt="Jorge7u7_0-1691089463806.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you said, there is no direct 32K clock source which can be assigned to PWM blocks by multiplexer, but some of the clock sources comes from the clock control module.&lt;/P&gt;
&lt;P&gt;And according to fsl_pwm.h, these are the definitions to the clock sources:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jorge7u7_1-1691089470322.png" style="width: 658px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/234997i0113E275C09F667E/image-dimensions/658x94?v=v2" width="658" height="94" role="button" title="Jorge7u7_1-1691089470322.png" alt="Jorge7u7_1-1691089470322.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 19:04:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1698850#M210247</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2023-08-03T19:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8MM, Cortex-M4, PWM: calculate the clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1699191#M210282</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203308"&gt;@JorgeCas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;okay, thank you. I'll have to dig deeper into it to fully understand how peripheral clocking works.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 07:16:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8MM-Cortex-M4-PWM-calculate-the-clock-frequency/m-p/1699191#M210282</guid>
      <dc:creator>Raal</dc:creator>
      <dc:date>2023-08-04T07:16:52Z</dc:date>
    </item>
  </channel>
</rss>

