<?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: LPI2C: Inverted SCL on S32k144 in S32K</title>
    <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1785300#M30439</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227167"&gt;@ArushThomas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If the non-blocking API is used (I2C_MasterSendData()), we need to use the I2C_MasterGetTransferStatus() before we can call I2C_MasterSendData() again.&lt;/P&gt;
&lt;P&gt;Can you use it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2024 13:55:20 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2024-01-09T13:55:20Z</dc:date>
    <item>
      <title>LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1776103#M29697</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I was trying to configure an S32k144 as an I2C Master, and seem to have encountered a bug. The SCL waveform is inverted (HIGH when it should be LOW, and vice-versa). I have observed this behaviour on my Oscilloscope;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pink: SCL&lt;/LI&gt;&lt;LI&gt;yellow: SDA&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SCL_Invert.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/254777i7508B4A638255ABE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SCL_Invert.png" alt="SCL_Invert.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This behaviour is observed in Debug mode, when I disable all breakpoints and let the code run at regular speed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I step through the code line-by-line with the Debug features, I observe different behaviour&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SCL_Correct.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/254778i75C2904C6158B5F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SCL_Correct.png" alt="SCL_Correct.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the waveform I had expected at all times.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The S32k144 is configured as a Master I2C device, and no other devices are present on the bus.&lt;/LI&gt;&lt;LI&gt;I am using the LPI2C0 peripheral, on pins PTA3 and PTA2.&lt;UL&gt;&lt;LI&gt;Pins PTB7 and PTB6 are connected to an External crystal oscillator, so I haven't tested those.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;External 4.7k pull-up resistors are connected to the SCL and SDA signals.&lt;/LI&gt;&lt;LI&gt;I have verified open-drain configuration of the pins, and all Clock settings.&lt;/LI&gt;&lt;LI&gt;Both the Blocking and Non-Blocking methods provide the same waveforms. [I2C_MasterSendDataBlocking() and I2C_MasterSendData()]&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here's the code;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Main.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/254785iE77AA86D5132BAB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Main.png" alt="Main.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EDIT: Added project "I2C_Reconfig.zip", which produces this issue&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 05:15:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1776103#M29697</guid>
      <dc:creator>ArushThomas</dc:creator>
      <dc:date>2023-12-20T05:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1777097#M29771</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227167"&gt;@ArushThomas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you attach the project here so that I can reproduce it?&lt;/P&gt;
&lt;P&gt;Is the LPI2C module reporting any error during the test?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 10:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1777097#M29771</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-12-19T10:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1777596#M29804</link>
      <description>&lt;P&gt;Sure! I've edited my original post to attach the project .zip file&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Is the LPI2C module reporting any error during the test?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've used the &lt;EM&gt;status_t error&amp;nbsp;&lt;/EM&gt;variable to identify if any function returns an error status. All Init() functions return &lt;EM&gt;STATUS_SUCCESS&lt;/EM&gt;. The I2C_MasterSendDataBlocking() function returns&amp;nbsp;&lt;EM&gt;STATUS_I2C_RECEIVED_NACK&lt;/EM&gt;. I expected this, since there is no Slave on the I2C bus.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;I2C_MasterSendData() function returns&amp;nbsp;&lt;EM&gt;STATUS_SUCCESS.&lt;/EM&gt; I did not expect this, I was expecting NACK again.&lt;/P&gt;&lt;P&gt;Is there some other technique I need to follow, to identify if the LPI2C module reports an error?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 05:23:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1777596#M29804</guid>
      <dc:creator>ArushThomas</dc:creator>
      <dc:date>2023-12-20T05:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1778756#M29866</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227167"&gt;@ArushThomas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The SCL signal is not inverted but shifted.&lt;/P&gt;
&lt;DIV id="tinyMceEditor_52347b89a7dfd6danielmartynek_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_2-1703165408513.png" style="width: 665px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255541iBE142F8AD5C6EDF6/image-dimensions/665x246?v=v2" width="665" height="246" role="button" title="danielmartynek_2-1703165408513.png" alt="danielmartynek_2-1703165408513.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_3-1703165420576.png" style="width: 663px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255542i8727ED3B89AEDC64/image-dimensions/663x272?v=v2" width="663" height="272" role="button" title="danielmartynek_3-1703165420576.png" alt="danielmartynek_3-1703165420576.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I could not open your project, because you use an older SDK, unfortunately.&lt;/P&gt;
&lt;P&gt;Nevertheless, I could reproduce it with a simple bare-metal code.&lt;/P&gt;
&lt;P&gt;We can see the shift when the LPI2C module is operational in active debug mode.&lt;/P&gt;
&lt;P&gt;MCR_DBGEN = 0&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_4-1703165612779.png" style="width: 547px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255543i425323E76BF61B64/image-dimensions/547x78?v=v2" width="547" height="78" role="button" title="danielmartynek_4-1703165612779.png" alt="danielmartynek_4-1703165612779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;MCR_DBGEN = 1&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_5-1703165638715.png" style="width: 547px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255544iCE6D5173625F8E77/image-dimensions/547x137?v=v2" width="547" height="137" role="button" title="danielmartynek_5-1703165638715.png" alt="danielmartynek_5-1703165638715.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you don't need the module active while the CPU is halted in debug mode, clear DBGEN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 13:40:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1778756#M29866</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-12-21T13:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1778758#M29867</link>
      <description>&lt;P&gt;Regarding the non-blocking method: The I2C_MasterSendData(),&lt;/P&gt;
&lt;P&gt;The function completes before the transfer is finished, it does not block the core during the transfer.&lt;/P&gt;
&lt;P&gt;We need to use this API: I2C_MasterGetTransferStatus() to get the expected STATUS_I2C_RECEIVED_NACK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 13:45:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1778758#M29867</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-12-21T13:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1784244#M30355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160001"&gt;@danielmartynek&lt;/a&gt;, thanks for your reply!&lt;/P&gt;&lt;P&gt;I've tried to implement your solution, here's my code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;I2C_MasterInit(&amp;amp;i2c1_instance, &amp;amp;i2c1_MasterConfig0);
LPI2C0-&amp;gt;MCR |= LPI2C_MCR_DBGEN_MASK; //MCR value is set to 9
//LPI2C0-&amp;gt;MCR &amp;amp;= ~LPI2C_MCR_DBGEN_MASK; //MCR value is set to 1
for(;;){
  I2C_MasterSendData(&amp;amp;i2c1_instance, masterTxBuffer, TRANSFER_SIZE, true);
  OSIF_TimeDelay(50);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Probing the waveforms on my scope again, I'm not seeing any difference; the SCL waveform is still Shifted, whether MCR is 9 or 1.&lt;/P&gt;&lt;P&gt;As a sanity check, I set MCR_MEN to 0, to verify I was writing to the correct register. This completely stopped all waveforms, as I had expected. (Master logic is disabled)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Incidentally, I am not facing this issue when I set the Baud Rate to 400kHz; This issue only seems to present itself at 100kHz&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Correct waveform observed @400kHz" style="width: 800px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/257031i6176E4E39241CC78/image-size/large?v=v2&amp;amp;px=999" role="button" title="4kHz.png" alt="Correct waveform observed @400kHz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Correct waveform observed @400kHz&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 08:40:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1784244#M30355</guid>
      <dc:creator>ArushThomas</dc:creator>
      <dc:date>2024-01-08T08:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPI2C: Inverted SCL on S32k144</title>
      <link>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1785300#M30439</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227167"&gt;@ArushThomas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If the non-blocking API is used (I2C_MasterSendData()), we need to use the I2C_MasterGetTransferStatus() before we can call I2C_MasterSendData() again.&lt;/P&gt;
&lt;P&gt;Can you use it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 13:55:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPI2C-Inverted-SCL-on-S32k144/m-p/1785300#M30439</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-01-09T13:55:20Z</dc:date>
    </item>
  </channel>
</rss>

