<?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のトピックBug in I2C driver lpc17xx_i2c.c</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-in-I2C-driver-lpc17xx-i2c-c/m-p/522968#M5604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jeffaroo on Fri Feb 07 21:24:10 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I don’t know the correct place to report bug in the LPC1700CMSIS Standard Peripheral Firmware Library, but this seems as good as any...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I’ve been having a problem with generating the STOP condition when sending multiple i2c packets *immediately* following each other using the lpc17xx_i2c.c driver in polling mode.&amp;nbsp; The STOP condition is correctly generated for each packet when there is a very small pause between packets, but without the pause only the last packet generates the STOP condition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at the I2C_Start() function I see that the STOP flag is cleared by setting the the I2C_I2CONCLR_STOC bit (bit number 4) in the I2C Control Clear register (I2CONCLR).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;I2Cx-&amp;gt;I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, according to the the LPC176x manual there is *no* STOP clear bit in the I2CONCLR register.&amp;nbsp; Bit number 4 (where you would expect the stop clear bit to be if there was one) is *reserved* and should *not* be set. So the code is violating the manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not only does the code disagree with the manual, but it’s also logically incorrect. With this code if you send a second i2c packet before the first packet has had time to generate the STOP condition this code won’t allow the STOP condition of the first packet to be generated.&amp;nbsp; In other words, this code incorrectly clears any pending STOP conditions of pervious packets.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code seems to work fine by eliminating all references to the I2C_I2CONCLR_STOC bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additionally, in the header file the I2C_I2CONCLR_STOC define should be eliminated since the manual sezs there’s no such thing…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;By the way, it doesn’t look like the git archive (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fgit.lpcware.com%2F%2Flpc175x_6x.git" rel="nofollow noopener noreferrer" target="_blank"&gt;http://git.lpcware.com//lpc175x_6x.git&lt;/A&gt;&lt;SPAN&gt;) has been updated in over any year.&amp;nbsp; Is this a link stale?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:59:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:59:59Z</dc:date>
    <item>
      <title>Bug in I2C driver lpc17xx_i2c.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-in-I2C-driver-lpc17xx-i2c-c/m-p/522968#M5604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jeffaroo on Fri Feb 07 21:24:10 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I don’t know the correct place to report bug in the LPC1700CMSIS Standard Peripheral Firmware Library, but this seems as good as any...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I’ve been having a problem with generating the STOP condition when sending multiple i2c packets *immediately* following each other using the lpc17xx_i2c.c driver in polling mode.&amp;nbsp; The STOP condition is correctly generated for each packet when there is a very small pause between packets, but without the pause only the last packet generates the STOP condition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at the I2C_Start() function I see that the STOP flag is cleared by setting the the I2C_I2CONCLR_STOC bit (bit number 4) in the I2C Control Clear register (I2CONCLR).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;I2Cx-&amp;gt;I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, according to the the LPC176x manual there is *no* STOP clear bit in the I2CONCLR register.&amp;nbsp; Bit number 4 (where you would expect the stop clear bit to be if there was one) is *reserved* and should *not* be set. So the code is violating the manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not only does the code disagree with the manual, but it’s also logically incorrect. With this code if you send a second i2c packet before the first packet has had time to generate the STOP condition this code won’t allow the STOP condition of the first packet to be generated.&amp;nbsp; In other words, this code incorrectly clears any pending STOP conditions of pervious packets.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code seems to work fine by eliminating all references to the I2C_I2CONCLR_STOC bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additionally, in the header file the I2C_I2CONCLR_STOC define should be eliminated since the manual sezs there’s no such thing…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;By the way, it doesn’t look like the git archive (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fgit.lpcware.com%2F%2Flpc175x_6x.git" rel="nofollow noopener noreferrer" target="_blank"&gt;http://git.lpcware.com//lpc175x_6x.git&lt;/A&gt;&lt;SPAN&gt;) has been updated in over any year.&amp;nbsp; Is this a link stale?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-in-I2C-driver-lpc17xx-i2c-c/m-p/522968#M5604</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:59Z</dc:date>
    </item>
  </channel>
</rss>

