<?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 S32K3 measuring PWM duty cycle (eMIOS ICU IPWM) without blocking in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K3-measuring-PWM-duty-cycle-eMIOS-ICU-IPWM-without-blocking/m-p/2366505#M58646</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;For context -&lt;BR /&gt;I am using an eMIOS ICU channel to measure a varying PWM duty cycle in IPWM mode. I am currently able to successfully measure duty cycle in a "blocking" manner.&lt;BR /&gt;&lt;BR /&gt;My input transitions from 100% duty cycle (effectively no PWM) to a PWM signal of a given duty cycle which I need to measure.&lt;/P&gt;&lt;P&gt;My .mex configuration is as follows -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_0-1778951748752.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385658i9281C78FFB88E39D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_0-1778951748752.png" alt="Hareesh_S_0-1778951748752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_1-1778951764813.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385659i355841AE2F0E388C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_1-1778951764813.png" alt="Hareesh_S_1-1778951764813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My sample code is as follows -&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_2-1778952311888.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385660iB49D07A980A1AC36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_2-1778952311888.png" alt="Hareesh_S_2-1778952311888.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;While this works, I would prefer to start signal measurement once and periodically call&amp;nbsp;&lt;SPAN&gt;Emios_Icu_Ip_GetDutyCycleValues(), without having to call Emios_Icu_Ip_StopSignalMeasurement(), to avoid being blocked before the measurement is complete. Alternatively, if there is a interrupt fired whenever a measurement has completed, that would work for me too.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I have tried only calling&amp;nbsp;&lt;SPAN&gt;Emios_Icu_Ip_StartSignalMeasurement() initially and calling&amp;nbsp;Emios_Icu_Ip_GetDutyCycleValues() periodically (every 1 second, while the PWM frequency is 1kHz), but the data is inaccurate.&lt;BR /&gt;&lt;BR /&gt;From my understanding, SAIC is better suited for varying PWM signals (which I believe fits my usecase), but I assume I could also use IPWM, with a delayed measurement reading. I do not mind if the returned result is slightly delayed or stale by few milliseconds as I am not expecting rapid changes in duty cycle, and the frequency will be constant.&lt;BR /&gt;&lt;BR /&gt;If someone can clarify how I can achieve this using IPWM, or if I can only implement this via SAIC, that would be great.&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 May 2026 19:19:51 GMT</pubDate>
    <dc:creator>Hareesh_S</dc:creator>
    <dc:date>2026-05-16T19:19:51Z</dc:date>
    <item>
      <title>S32K3 measuring PWM duty cycle (eMIOS ICU IPWM) without blocking</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-measuring-PWM-duty-cycle-eMIOS-ICU-IPWM-without-blocking/m-p/2366505#M58646</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;For context -&lt;BR /&gt;I am using an eMIOS ICU channel to measure a varying PWM duty cycle in IPWM mode. I am currently able to successfully measure duty cycle in a "blocking" manner.&lt;BR /&gt;&lt;BR /&gt;My input transitions from 100% duty cycle (effectively no PWM) to a PWM signal of a given duty cycle which I need to measure.&lt;/P&gt;&lt;P&gt;My .mex configuration is as follows -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_0-1778951748752.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385658i9281C78FFB88E39D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_0-1778951748752.png" alt="Hareesh_S_0-1778951748752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_1-1778951764813.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385659i355841AE2F0E388C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_1-1778951764813.png" alt="Hareesh_S_1-1778951764813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My sample code is as follows -&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hareesh_S_2-1778952311888.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/385660iB49D07A980A1AC36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hareesh_S_2-1778952311888.png" alt="Hareesh_S_2-1778952311888.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;While this works, I would prefer to start signal measurement once and periodically call&amp;nbsp;&lt;SPAN&gt;Emios_Icu_Ip_GetDutyCycleValues(), without having to call Emios_Icu_Ip_StopSignalMeasurement(), to avoid being blocked before the measurement is complete. Alternatively, if there is a interrupt fired whenever a measurement has completed, that would work for me too.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I have tried only calling&amp;nbsp;&lt;SPAN&gt;Emios_Icu_Ip_StartSignalMeasurement() initially and calling&amp;nbsp;Emios_Icu_Ip_GetDutyCycleValues() periodically (every 1 second, while the PWM frequency is 1kHz), but the data is inaccurate.&lt;BR /&gt;&lt;BR /&gt;From my understanding, SAIC is better suited for varying PWM signals (which I believe fits my usecase), but I assume I could also use IPWM, with a delayed measurement reading. I do not mind if the returned result is slightly delayed or stale by few milliseconds as I am not expecting rapid changes in duty cycle, and the frequency will be constant.&lt;BR /&gt;&lt;BR /&gt;If someone can clarify how I can achieve this using IPWM, or if I can only implement this via SAIC, that would be great.&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2026 19:19:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-measuring-PWM-duty-cycle-eMIOS-ICU-IPWM-without-blocking/m-p/2366505#M58646</guid>
      <dc:creator>Hareesh_S</dc:creator>
      <dc:date>2026-05-16T19:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 measuring PWM duty cycle (eMIOS ICU IPWM) without blocking</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-measuring-PWM-duty-cycle-eMIOS-ICU-IPWM-without-blocking/m-p/2366709#M58657</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The issue you’re hitting is a known limitation of the eMIOS ICU IPWM mode on S32K3:&lt;BR /&gt;IPWM is inherently “measurement-window based”, not continuous, so reading it periodically without restarting/closing the measurement leads to stale or partially updated values.&lt;/P&gt;
&lt;P&gt;IPWM is not designed for unsynchronized periodic polling&lt;BR /&gt;You must either:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;use interrupt notification, or&lt;/LI&gt;
&lt;LI&gt;restart measurement before reading, or&lt;/LI&gt;
&lt;LI&gt;switch to SAIC for true non-blocking continuous measurement&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2026 07:20:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-measuring-PWM-duty-cycle-eMIOS-ICU-IPWM-without-blocking/m-p/2366709#M58657</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2026-05-18T07:20:38Z</dc:date>
    </item>
  </channel>
</rss>

