<?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: I2C problem in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560361#M15832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cmcquaid on Tue Apr 23 10:51:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Genesy&lt;/STRONG&gt;&lt;BR /&gt;Can you give me an example, please?&lt;BR /&gt;When the write not work it return the status code 11 that is a TIMEOUT error. Perhaps because in the meantime I read even at a rate of 300ms by an accelerometer always I2C and perhaps write command found the bus busy. How can I fix?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is not the I2C bus that is busy, it is your EEPROM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you get a timeout, that is just the EEPROM's way of saying "try again later".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use a variable to keep track of how much data you need to write. Each time through your [FONT=Courier New]while[/FONT] loop, if you have data, try to write to the EEPROM. If the write succeeds, decrement your variable by the amount of data written.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:52:24 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:52:24Z</dc:date>
    <item>
      <title>I2C problem</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560358#M15829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Mon Apr 22 02:55:22 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with I2C. In my project I would to write same parameter in memory when I received a command from CANOpen register. Some command call two I2C Write consecutive and in this case the parameter is not written. On other occasions I resolved the problem with a empty waiting cycle like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[FONT=Courier New]void EEPROM_delayBetweenOp(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile int i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for ( i = 0; i &amp;lt; 0x20000; i++ );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}[/FONT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but not in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you a workaround for this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560358#M15829</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: I2C problem</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560359#M15830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cmcquaid on Mon Apr 22 10:46:07 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It takes a finite amount of time to write to an EEPROM, typically on the order of milliseconds. This is likely to be longer than the time between consecutive instructions on your microcontroller. It is common for EEPROMs not to acknowledge their address during a programming cycle, so you can wait for an ACK before proceeding rather than having a delay.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should check your specific EEPROM datasheet for details.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560359#M15830</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: I2C problem</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560360#M15831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Tue Apr 23 01:52:29 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you give me an example, please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use the I2C driver in I2C example that have this function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[FONT=Courier New][SIZE=2]uint32_t I2CEngine( void ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RdIndex = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; WrIndex = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; /*--- Issue a start condition ---*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_I2C-&amp;gt;CONSET = I2CONSET_STA;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set Start flag */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I2CMasterState = I2C_BUSY;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; while ( I2CMasterState == I2C_BUSY )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( timeout &amp;gt;= MAX_TIMEOUT )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2CMasterState = I2C_TIME_OUT;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeout++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_I2C-&amp;gt;CONCLR = I2CONCLR_STAC;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return ( I2CMasterState );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}[/SIZE][/FONT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the write not work it return the status code 11 that is a TIMEOUT error. Perhaps because in the meantime I read even at a rate of 300ms by an accelerometer always I2C and perhaps write command found the bus busy. How can I fix?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:52:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560360#M15831</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: I2C problem</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560361#M15832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cmcquaid on Tue Apr 23 10:51:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Genesy&lt;/STRONG&gt;&lt;BR /&gt;Can you give me an example, please?&lt;BR /&gt;When the write not work it return the status code 11 that is a TIMEOUT error. Perhaps because in the meantime I read even at a rate of 300ms by an accelerometer always I2C and perhaps write command found the bus busy. How can I fix?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is not the I2C bus that is busy, it is your EEPROM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you get a timeout, that is just the EEPROM's way of saying "try again later".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use a variable to keep track of how much data you need to write. Each time through your [FONT=Courier New]while[/FONT] loop, if you have data, try to write to the EEPROM. If the write succeeds, decrement your variable by the amount of data written.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:52:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-problem/m-p/560361#M15832</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:52:24Z</dc:date>
    </item>
  </channel>
</rss>

