<?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 EMIOS sysncarations in S32K</title>
    <link>https://community.nxp.com/t5/S32K/EMIOS-sysncarations/m-p/2181361#M53287</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;BR /&gt;I’ve designed a motor control system using a motor driver that has two inputs: &lt;STRONG&gt;IN1&lt;/STRONG&gt; and &lt;STRONG&gt;IN2&lt;/STRONG&gt;. Here's how the system works:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;IN1 is always high&lt;/STRONG&gt;, so the motor continuously rotates forward.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;IN2 is modulated using eMIOS_0_CH15&lt;/STRONG&gt;, which allows me to control the current flowing through the motor.&lt;/LI&gt;&lt;LI&gt;When both IN1 and IN2 are high, the motor enters &lt;STRONG&gt;slow decay mode&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;When IN2 is low, current actively flows through the motor — this is the phase I want to measure.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To ensure accurate current measurement, I’ve configured &lt;STRONG&gt;eMIOS_0_CH15 with active-low polarity&lt;/STRONG&gt;, so the signal starts low. This way, the current flows during the low phase, and I can sample the ADC at the beginning of the PWM period when current starts flowing.&lt;/P&gt;&lt;H3&gt;ADC Trigger Setup:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;I’ve configured &lt;STRONG&gt;eMIOS_0_CH1 in OPWMT mode&lt;/STRONG&gt; to trigger the ADC.&lt;/LI&gt;&lt;LI&gt;Both &lt;STRONG&gt;eMIOS_0_CH1&lt;/STRONG&gt; and &lt;STRONG&gt;eMIOS_0_CH15&lt;/STRONG&gt; share the same &lt;STRONG&gt;timebase (eMIOS_0_CH23)&lt;/STRONG&gt; and &lt;STRONG&gt;period&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;The &lt;STRONG&gt;minimum duty cycle&lt;/STRONG&gt; where current can be reliably measured is &lt;STRONG&gt;4%&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;The Issue:&lt;/H3&gt;&lt;P&gt;Even though both channels share the same timebase and period, the &lt;STRONG&gt;flag generation from eMIOS_0_CH1 occurs ~2 µs later&lt;/STRONG&gt; than the start of the PWM signal on eMIOS_0_CH15. This misalignment causes the ADC to sample &lt;STRONG&gt;before&lt;/STRONG&gt; current starts flowing, which is not desired.&lt;/P&gt;&lt;P&gt;I’ve created an example project to help debug this issue. I’d appreciate your help in identifying the cause and finding a solution to ensure the ADC trigger aligns precisely with the start of the current flow.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ayaz_0-1759855520349.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/359777i98CD200D3607A842/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ayaz_0-1759855520349.png" alt="Ayaz_0-1759855520349.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;S32k344&lt;BR /&gt;RTD:6.0.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2025 16:47:14 GMT</pubDate>
    <dc:creator>Ayaz</dc:creator>
    <dc:date>2025-10-07T16:47:14Z</dc:date>
    <item>
      <title>EMIOS sysncarations</title>
      <link>https://community.nxp.com/t5/S32K/EMIOS-sysncarations/m-p/2181361#M53287</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;BR /&gt;I’ve designed a motor control system using a motor driver that has two inputs: &lt;STRONG&gt;IN1&lt;/STRONG&gt; and &lt;STRONG&gt;IN2&lt;/STRONG&gt;. Here's how the system works:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;IN1 is always high&lt;/STRONG&gt;, so the motor continuously rotates forward.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;IN2 is modulated using eMIOS_0_CH15&lt;/STRONG&gt;, which allows me to control the current flowing through the motor.&lt;/LI&gt;&lt;LI&gt;When both IN1 and IN2 are high, the motor enters &lt;STRONG&gt;slow decay mode&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;When IN2 is low, current actively flows through the motor — this is the phase I want to measure.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To ensure accurate current measurement, I’ve configured &lt;STRONG&gt;eMIOS_0_CH15 with active-low polarity&lt;/STRONG&gt;, so the signal starts low. This way, the current flows during the low phase, and I can sample the ADC at the beginning of the PWM period when current starts flowing.&lt;/P&gt;&lt;H3&gt;ADC Trigger Setup:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;I’ve configured &lt;STRONG&gt;eMIOS_0_CH1 in OPWMT mode&lt;/STRONG&gt; to trigger the ADC.&lt;/LI&gt;&lt;LI&gt;Both &lt;STRONG&gt;eMIOS_0_CH1&lt;/STRONG&gt; and &lt;STRONG&gt;eMIOS_0_CH15&lt;/STRONG&gt; share the same &lt;STRONG&gt;timebase (eMIOS_0_CH23)&lt;/STRONG&gt; and &lt;STRONG&gt;period&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;The &lt;STRONG&gt;minimum duty cycle&lt;/STRONG&gt; where current can be reliably measured is &lt;STRONG&gt;4%&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;The Issue:&lt;/H3&gt;&lt;P&gt;Even though both channels share the same timebase and period, the &lt;STRONG&gt;flag generation from eMIOS_0_CH1 occurs ~2 µs later&lt;/STRONG&gt; than the start of the PWM signal on eMIOS_0_CH15. This misalignment causes the ADC to sample &lt;STRONG&gt;before&lt;/STRONG&gt; current starts flowing, which is not desired.&lt;/P&gt;&lt;P&gt;I’ve created an example project to help debug this issue. I’d appreciate your help in identifying the cause and finding a solution to ensure the ADC trigger aligns precisely with the start of the current flow.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ayaz_0-1759855520349.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/359777i98CD200D3607A842/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ayaz_0-1759855520349.png" alt="Ayaz_0-1759855520349.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;S32k344&lt;BR /&gt;RTD:6.0.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 16:47:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/EMIOS-sysncarations/m-p/2181361#M53287</guid>
      <dc:creator>Ayaz</dc:creator>
      <dc:date>2025-10-07T16:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: EMIOS sysncarations</title>
      <link>https://community.nxp.com/t5/S32K/EMIOS-sysncarations/m-p/2182225#M53332</link>
      <description>&lt;P&gt;Thank you for your interest in our products and for contributing to our community.&lt;/P&gt;
&lt;P&gt;Flag for OPWMT is generated based in &lt;EM&gt;Trigger&lt;/EM&gt; parameter (for your case at tick 0).&lt;/P&gt;
&lt;P&gt;The delay of ~2us is the time that takes to the MCU to enter to the interrupt and toggle a pin. The issue is that PWM period is too fast.&lt;/P&gt;
&lt;P&gt;It can even be seen that the time to toggle a pin twice is considerable with respect to the established PWM period.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="_Leo__0-1759957833990.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/359948i6FB7280E5731DDA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="_Leo__0-1759957833990.png" alt="_Leo__0-1759957833990.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The workaround that I can propose to you, is to &lt;EM&gt;phase shift&lt;/EM&gt; the OPWMB signal to match the trigger into the low time period. A &lt;EM&gt;phase shift&lt;/EM&gt; of 50 ticks look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="_Leo__1-1759957853881.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/359949i616F0FC90822F986/image-size/large?v=v2&amp;amp;px=999" role="button" title="_Leo__1-1759957853881.png" alt="_Leo__1-1759957853881.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But I recommend you set the &lt;EM&gt;phase shift&lt;/EM&gt; value &lt;STRONG&gt;empirically&lt;/STRONG&gt; according to your needs.&lt;/P&gt;
&lt;P&gt;We hope this resolves your issue.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 21:12:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/EMIOS-sysncarations/m-p/2182225#M53332</guid>
      <dc:creator>_Leo_</dc:creator>
      <dc:date>2025-10-08T21:12:26Z</dc:date>
    </item>
  </channel>
</rss>

