<?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 Lower frequency PWM in OPWFMB mode in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Lower-frequency-PWM-in-OPWFMB-mode/m-p/1826787#M12019</link>
    <description>&lt;P&gt;Hi NXP team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using S32K344 EVK board and S32 design studio 3.5..&lt;/P&gt;&lt;P&gt;We require a PWM frequency of 0.5 Hz for the OPWFMB mode (variable frequency and variable duty cycle),&lt;/P&gt;&lt;P&gt;The system clock and ADC clock will both decrease if the EMIOS module frequency is lowered to achieve lower frequency PWM because both have the same source clock (CORE_CLK) (Please refer the attached screenshot).&lt;/P&gt;&lt;P&gt;Is it feasible to switch the EMIOS module's clock source from CORE_CLK? If so, how should it be done?&lt;/P&gt;&lt;P&gt;If we set the CORE_CLK = 20 MHz,&lt;/P&gt;&lt;P&gt;EMIOS_CLK = 20M / 16(&lt;EM&gt;Clock Prescaler&lt;/EM&gt;) = 1.25 MHz&lt;/P&gt;&lt;P&gt;Period [in ticks] = EMIOS_CLK / PWM in Hz&lt;/P&gt;&lt;P&gt;PWM in Hz = EMIOS_CLK / Period [in ticks]&lt;/P&gt;&lt;P&gt;PWM in Hz = 1.25 MHz / 65535 (&lt;EM&gt;The maximum value we can set in S32 DS IDE&lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;PWM in Hz =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;19.07 HZ&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thus, we will only obtain a minimum PWM frequency of 19.07 Hz when we use the maximum clock prescaler and period value combinations.&lt;/P&gt;&lt;P&gt;In order to get a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PWM frequency of 0.5 Hz in OPWFMB&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mode, what setups are required?&lt;/P&gt;&lt;P&gt;Please assist me in fixing this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Hareesh&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 04:24:43 GMT</pubDate>
    <dc:creator>Hareesh</dc:creator>
    <dc:date>2024-03-13T04:24:43Z</dc:date>
    <item>
      <title>Lower frequency PWM in OPWFMB mode</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Lower-frequency-PWM-in-OPWFMB-mode/m-p/1826787#M12019</link>
      <description>&lt;P&gt;Hi NXP team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using S32K344 EVK board and S32 design studio 3.5..&lt;/P&gt;&lt;P&gt;We require a PWM frequency of 0.5 Hz for the OPWFMB mode (variable frequency and variable duty cycle),&lt;/P&gt;&lt;P&gt;The system clock and ADC clock will both decrease if the EMIOS module frequency is lowered to achieve lower frequency PWM because both have the same source clock (CORE_CLK) (Please refer the attached screenshot).&lt;/P&gt;&lt;P&gt;Is it feasible to switch the EMIOS module's clock source from CORE_CLK? If so, how should it be done?&lt;/P&gt;&lt;P&gt;If we set the CORE_CLK = 20 MHz,&lt;/P&gt;&lt;P&gt;EMIOS_CLK = 20M / 16(&lt;EM&gt;Clock Prescaler&lt;/EM&gt;) = 1.25 MHz&lt;/P&gt;&lt;P&gt;Period [in ticks] = EMIOS_CLK / PWM in Hz&lt;/P&gt;&lt;P&gt;PWM in Hz = EMIOS_CLK / Period [in ticks]&lt;/P&gt;&lt;P&gt;PWM in Hz = 1.25 MHz / 65535 (&lt;EM&gt;The maximum value we can set in S32 DS IDE&lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;PWM in Hz =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;19.07 HZ&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thus, we will only obtain a minimum PWM frequency of 19.07 Hz when we use the maximum clock prescaler and period value combinations.&lt;/P&gt;&lt;P&gt;In order to get a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PWM frequency of 0.5 Hz in OPWFMB&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mode, what setups are required?&lt;/P&gt;&lt;P&gt;Please assist me in fixing this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Hareesh&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:24:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Lower-frequency-PWM-in-OPWFMB-mode/m-p/1826787#M12019</guid>
      <dc:creator>Hareesh</dc:creator>
      <dc:date>2024-03-13T04:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lower frequency PWM in OPWFMB mode</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Lower-frequency-PWM-in-OPWFMB-mode/m-p/1826861#M12021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;a 0.5Hz would be possible as well. there is also global prescaler that can be used to lower eMIOS channel clock.&lt;/P&gt;
&lt;P&gt;eMIOS is clocked from CORE_CLK (up to 160Mhz). eMIOS divides this clock by the global prescaler (MCR[GPRE] + 1) and routes the resulting prescaled clock output to the channel internal prescaler (Cn[UCPRE] + 1). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.&lt;BR /&gt;Finally assuming channel running in e.g. OPWFMB mode, its PWM frequency is calculated as&lt;/P&gt;
&lt;P&gt;PWM frequency = CORE_CLK / global prescaler / internal prescaler / B1&lt;/P&gt;
&lt;P&gt;B1 is a value written to channel B register.&lt;/P&gt;
&lt;P&gt;Refer to device RM for description of eMIOS modes.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 06:45:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Lower-frequency-PWM-in-OPWFMB-mode/m-p/1826861#M12021</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-03-13T06:45:07Z</dc:date>
    </item>
  </channel>
</rss>

