<?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>LPC MicrocontrollersのトピックI2C clocks stop after slave ack the address</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2081430#M58073</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the LPC824 I2C to talk with a IC slave. The goal is to have this kind of communication as reported in the slave manual&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tommino_0-1744785196731.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/333373iB3AAD1E41141DCC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tommino_0-1744785196731.png" alt="tommino_0-1744785196731.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Precondition: I2C HW is correctly working in my board since I can talk to different I2C slaves without issues ( I mean different type of devices...i have more than one unit of the I2C slave that is giving me the problem and I tried all of them and nothing changes).&lt;/P&gt;&lt;P&gt;The problem is that everything is fine until the part pointed by the arrow: LPC824 sends out the slave address which is ACK by the slave, then I have the register and then the I see another ACK in the SDA line but from now on: SCL line is stopped and no clock is present, SDA line keeps staying low forever. I think that the problem comes from the fact that no clock is present ( see oscilloscope screenschot attached).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is the following:&lt;/P&gt;&lt;P&gt;if((LPC_I2C0-&amp;gt;STAT &amp;amp; MSTSTATE) == MSTSTATE_IDLE){ /* if idle */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTDAT=(devaddr&amp;lt;&amp;lt;1); /* send addr w/ R/W bit =0 */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTSTART); /* send start condition */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING)) /* wait for i2c0 idle or pending */&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; // send register&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; LPC_I2C0-&amp;gt;MSTDAT=(reg_address);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING));&amp;nbsp; &amp;nbsp;/* wait for i2c0 idle or pending */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LPC_I2C0-&amp;gt;MSTDAT=(devaddr&amp;lt;&amp;lt; 1)|0x1; /* send addr w/ R/W bit =1 */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING)); /* wait for i2c0 idle or pending */&lt;BR /&gt;value1=LPC_I2C0-&amp;gt;MSTDAT;&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTSTOP)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any idea where is the bug?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 16 Apr 2025 06:45:59 GMT</pubDate>
    <dc:creator>tommino</dc:creator>
    <dc:date>2025-04-16T06:45:59Z</dc:date>
    <item>
      <title>I2C clocks stop after slave ack the address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2081430#M58073</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the LPC824 I2C to talk with a IC slave. The goal is to have this kind of communication as reported in the slave manual&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tommino_0-1744785196731.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/333373iB3AAD1E41141DCC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tommino_0-1744785196731.png" alt="tommino_0-1744785196731.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Precondition: I2C HW is correctly working in my board since I can talk to different I2C slaves without issues ( I mean different type of devices...i have more than one unit of the I2C slave that is giving me the problem and I tried all of them and nothing changes).&lt;/P&gt;&lt;P&gt;The problem is that everything is fine until the part pointed by the arrow: LPC824 sends out the slave address which is ACK by the slave, then I have the register and then the I see another ACK in the SDA line but from now on: SCL line is stopped and no clock is present, SDA line keeps staying low forever. I think that the problem comes from the fact that no clock is present ( see oscilloscope screenschot attached).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is the following:&lt;/P&gt;&lt;P&gt;if((LPC_I2C0-&amp;gt;STAT &amp;amp; MSTSTATE) == MSTSTATE_IDLE){ /* if idle */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTDAT=(devaddr&amp;lt;&amp;lt;1); /* send addr w/ R/W bit =0 */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTSTART); /* send start condition */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING)) /* wait for i2c0 idle or pending */&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; // send register&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; LPC_I2C0-&amp;gt;MSTDAT=(reg_address);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING));&amp;nbsp; &amp;nbsp;/* wait for i2c0 idle or pending */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LPC_I2C0-&amp;gt;MSTDAT=(devaddr&amp;lt;&amp;lt; 1)|0x1; /* send addr w/ R/W bit =1 */&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while(!(LPC_I2C0-&amp;gt;STAT &amp;amp; MSTPENDING)); /* wait for i2c0 idle or pending */&lt;BR /&gt;value1=LPC_I2C0-&amp;gt;MSTDAT;&lt;BR /&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTSTOP)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any idea where is the bug?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Apr 2025 06:45:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2081430#M58073</guid>
      <dc:creator>tommino</dc:creator>
      <dc:date>2025-04-16T06:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: I2C clocks stop after slave ack the address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2081493#M58074</link>
      <description>&lt;P&gt;I forgot the scope screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tommino_0-1744789081298.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/333404i7EE55D813EF7C83F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tommino_0-1744789081298.png" alt="tommino_0-1744789081298.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 07:38:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2081493#M58074</guid>
      <dc:creator>tommino</dc:creator>
      <dc:date>2025-04-16T07:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: I2C clocks stop after slave ack the address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2083213#M58098</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/249400"&gt;@tommino&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank&amp;nbsp; you for your contacting us.&lt;/P&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-qzbcQC paragraph-element br-paragraph-space"&gt;In an I2C read operation, when switching from "writing the register address" to "reading data", a ​​Repeated Start​​ signal needs to be sent instead of directly sending the read address.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-qzbcQC paragraph-element br-paragraph-space"&gt;&lt;FONT color="#000000"&gt;The current code uses&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;MSTCONTINUE&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;before sending the read address. This causes the timing to not comply with the standard I2C specification. Therefore, please change&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;LPC_I2C0-&amp;gt;MSTCTL=(1&amp;lt;&amp;lt;MSTCONTINUE);&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;LPC_I2C0-&amp;gt;MSTCTL = (1 &amp;lt;&amp;lt; MSTSTART);&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;before t&lt;/FONT&gt;he read operation.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 08:57:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-clocks-stop-after-slave-ack-the-address/m-p/2083213#M58098</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2025-04-18T08:57:28Z</dc:date>
    </item>
  </channel>
</rss>

