<?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>S32KのトピックRe: cmp</title>
    <link>https://community.nxp.com/t5/S32K/cmp/m-p/2084495#M47985</link>
    <description>&lt;P&gt;Yes, this is a different issue from the one I posted earlier. I would still like to resolve the question here, as I am specifically looking to get the LPCMP working for switching based on the current waveform. I kindly request your support on this matter.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Apr 2025 09:21:10 GMT</pubDate>
    <dc:creator>GaneshBhagwat</dc:creator>
    <dc:date>2025-04-22T09:21:10Z</dc:date>
    <item>
      <title>cmp</title>
      <link>https://community.nxp.com/t5/S32K/cmp/m-p/2074893#M47514</link>
      <description>&lt;P&gt;Hi N,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm working on a project using the &lt;/SPAN&gt;&lt;SPAN&gt;S32K358&lt;/SPAN&gt;&lt;SPAN&gt; and encountering challenges related to &lt;/SPAN&gt;&lt;SPAN&gt;zero-crossing detection at 85kHz&lt;/SPAN&gt;&lt;SPAN&gt;. I’m currently utilizing the &lt;/SPAN&gt;&lt;SPAN&gt;LPCMP module&lt;/SPAN&gt;&lt;SPAN&gt; in both of the following modes:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;CMP_IP_FUNCTIONALMODE_CONTINUOUS&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;CMP_IP_FUNCTIONALMODE_SAMPLED_FILTERED_INT_CLK (with a delay of ~1µs)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Additionally, I’ve implemented the &lt;/SPAN&gt;&lt;SPAN&gt;windowing functionality&lt;/SPAN&gt;&lt;SPAN&gt; with the same sampled/filtered mode. As per the reference manual, windowing is particularly recommended for high-frequency zero-crossing detection, like in my case at 85kHz. However, this requires a window signal input via &lt;/SPAN&gt;&lt;SPAN&gt;TRGMUX&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Current Setup:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;I’m using &lt;/SPAN&gt;&lt;SPAN&gt;eMIOS&lt;/SPAN&gt;&lt;SPAN&gt; to generate the window signal.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;However, the &lt;/SPAN&gt;&lt;SPAN&gt;PWM from eMIOS is independently running&lt;/SPAN&gt;&lt;SPAN&gt; and not synchronized with the input zero-crossing signal.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;This lack of synchronization between the &lt;/SPAN&gt;&lt;SPAN&gt;PWM window&lt;/SPAN&gt;&lt;SPAN&gt; and the &lt;/SPAN&gt;&lt;SPAN&gt;zero-crossing signal&lt;/SPAN&gt;&lt;SPAN&gt; is causing challenges in reliable detection.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I'm currently testing with a square wave input just to observe the behavior and delay in zero-crossing, but my final application involves a more dynamic signal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;How can I synchronize the window signal with the input zero-crossing?&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;The reference manual states that windowing should be synchronized with the signal for accurate detection at high frequencies like 85kHz. Is there a recommended method to achieve this synchronization, particularly between eMIOS PWM and the input signal?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Is there a way to introduce a controlled delay (or phase shift) in the zero-crossing signal?&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;I’m looking to possibly &lt;/SPAN&gt;&lt;SPAN&gt;lag&lt;/SPAN&gt;&lt;SPAN&gt; the signal to adjust the crossing point. Is there any way to achieve this via hardware settings or using internal delay features?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Can the LPCMP be configured to use different reference voltages for rising and falling edges?&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Essentially, I want to differentiate the threshold for positive and negative transitions if possible.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additional Context:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Signal frequency: &lt;/SPAN&gt;&lt;SPAN&gt;85kHz&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Reference voltage: &lt;/SPAN&gt;&lt;SPAN&gt;Approx. 2.7V&lt;/SPAN&gt;&lt;SPAN&gt;, configured via &lt;/SPAN&gt;&lt;SPAN&gt;DAC (value 126)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;I’d appreciate any guidance or suggestions on how to implement a more &lt;/SPAN&gt;&lt;SPAN&gt;deterministic and synchronized zero-crossing detection&lt;/SPAN&gt;&lt;SPAN&gt; mechanism, possibly with &lt;/SPAN&gt;&lt;SPAN&gt;edge-specific control&lt;/SPAN&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;SPAN&gt;window alignment&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;, I’d really appreciate your input on this if you have a moment.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 07:12:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/cmp/m-p/2074893#M47514</guid>
      <dc:creator>GaneshBhagwat</dc:creator>
      <dc:date>2025-04-07T07:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: cmp</title>
      <link>https://community.nxp.com/t5/S32K/cmp/m-p/2074919#M47517</link>
      <description>'dynamic signal' this is Sin Wave of 85KHz. But sometime its shape is not exact sin,thus mentioned like this</description>
      <pubDate>Mon, 07 Apr 2025 07:46:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/cmp/m-p/2074919#M47517</guid>
      <dc:creator>GaneshBhagwat</dc:creator>
      <dc:date>2025-04-07T07:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: cmp</title>
      <link>https://community.nxp.com/t5/S32K/cmp/m-p/2084079#M47963</link>
      <description>&lt;P&gt;Sorry for the delay. We currently have a backlog of cases and we try to resolve them as soon as possible.&lt;/P&gt;
&lt;P&gt;I see your other post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/Routing-Comparator-LPCMP-Output-to-eMIOS-IPWM-Mode-for-Frequency/m-p/2083829/highlight/false#M47953" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/S32K/Routing-Comparator-LPCMP-Output-to-eMIOS-IPWM-Mode-for-Frequency/m-p/2083829/highlight/false#M47953&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Do you still need help in this one? Or do we focus in the aforementioned?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 22:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/cmp/m-p/2084079#M47963</guid>
      <dc:creator>_Leo_</dc:creator>
      <dc:date>2025-04-21T22:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: cmp</title>
      <link>https://community.nxp.com/t5/S32K/cmp/m-p/2084495#M47985</link>
      <description>&lt;P&gt;Yes, this is a different issue from the one I posted earlier. I would still like to resolve the question here, as I am specifically looking to get the LPCMP working for switching based on the current waveform. I kindly request your support on this matter.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 09:21:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/cmp/m-p/2084495#M47985</guid>
      <dc:creator>GaneshBhagwat</dc:creator>
      <dc:date>2025-04-22T09:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: cmp</title>
      <link>https://community.nxp.com/t5/S32K/cmp/m-p/2090800#M48389</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;It is easily to synchronize window signal with the input zero-crossing in motor control applications because PWM signals for actuation can use the same time base as PWM for window signal and thus it is known the zero-crossing event. But in your particular case, the &lt;EM&gt;dynamic signal&lt;/EM&gt; is external.&lt;/P&gt;
&lt;P&gt;Hardware workaround (offloading the CPU) which comes to my mind is the following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_Leo__0-1746152600381.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336029i727C07CF5312276C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_Leo__0-1746152600381.png" alt="_Leo__0-1746152600381.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You need to route your &lt;EM&gt;dynamic signal&lt;/EM&gt; to two pins, one for CMP_0 and the other one for cmp1.&lt;/P&gt;
&lt;P&gt;CMP_0 will perform &lt;EM&gt;Continuous mode&lt;/EM&gt; to transform sine wave into an square wave. Then such signal is routed to LCU (though TRGMUX) to perform phase shift in order to serves as window signal of CMP_1 (again though TRGMUX). Finally CMP_1 should perform &lt;EM&gt;Windowed mode&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;For the part in green&amp;nbsp;from the diagram above you can refer to the attached example.&lt;/P&gt;
&lt;P&gt;Such example generates a PWM signal in PTB16 (&lt;EM&gt;emios_0_ch_4_g&lt;/EM&gt;) (in scope yellow signal). Receive the PWM signal in PTD15 (&lt;EM&gt;cmp0_in1&lt;/EM&gt;) and replicates it in PTE3 (&lt;EM&gt;cmp0_out&lt;/EM&gt;) (green signal). Then such signal is routed thought TRGMUX to PTA1 (&lt;EM&gt;trgmux_out0&lt;/EM&gt;) (blue signal) and also it is routed to LCU in PTD3 (&lt;EM&gt;lcu0_out0&lt;/EM&gt;) (purple signal), where PWM signal is phase shifted.&lt;/P&gt;
&lt;P&gt;Connections required: PTB16 -&amp;gt; PTD15&lt;/P&gt;
&lt;P&gt;S32DS 3.6 + RTD 5.0.0 (S32K3X4EVB-T172)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_Leo__1-1746152625408.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336030i5F4CC77189A84160/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_Leo__1-1746152625408.png" alt="_Leo__1-1746152625408.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the different threshold for positive and negative transitions, it is not possible.&lt;/P&gt;
&lt;P&gt;Hope it helps you.&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 02:28:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/cmp/m-p/2090800#M48389</guid>
      <dc:creator>_Leo_</dc:creator>
      <dc:date>2025-05-02T02:28:10Z</dc:date>
    </item>
  </channel>
</rss>

