<?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中的主题 Re: [solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575790#M19310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Thu Apr 21 08:01:27 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Could be useful to read:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc1769-i2c-not-working" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/lpc1769-i2c-not-working&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:15:42 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:15:42Z</dc:date>
    <item>
      <title>[solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575788#M19308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mos87 on Mon Apr 18 08:27:56 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;im owning an &lt;/SPAN&gt;&lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fhttps%3A%2F%2Fwww.embeddedartists.com%2Fproducts%2Flpcxpresso%2Flpc1769_xpr.php" rel="nofollow noopener noreferrer" target="_blank"&gt;LPCXpresso 1769 board&lt;/A&gt;&lt;SPAN&gt; and want to access the 24LC64 EEPROM who is also at the board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The EEPROM is connected to I2C1 at the Pins P0.19 and P0.20.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How I see it I should be able too access the EEPROM via I2C without any hardware changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying the run the periph_i2c example from the LPCopen V2.10 to learn how to use the lib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the example I disabled the initialization of I2C0 and the virtual Slaves and wanted to check all Bus devices with the i2c_probe_slaves() function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
static void i2c_probe_slaves(I2C_ID_T i2c)
{
int i;
uint8_t ch[2];

DEBUGOUT("Probing available I2C devices...\r\n");
DEBUGOUT("\r\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
DEBUGOUT("\r\n====================================================");
for (i = 0; i &amp;lt;= 0x7F; i++) {
if (!(i &amp;amp; 0x0F)) DEBUGOUT("\r\n%02X&amp;nbsp; ", i &amp;gt;&amp;gt; 4);
if (i &amp;lt;= 7 || i &amp;gt; 0x78) {
DEBUGOUT("&amp;nbsp;&amp;nbsp; ");
continue;
}
/* Address 0x48 points to LM75AIM device which needs 2 bytes be read */
if(Chip_I2C_MasterRead(i2c, i, ch, 1 + (i == 0x48)) &amp;gt; 0)
DEBUGOUT(" %02X", i);
else
DEBUGOUT(" --");
}
DEBUGOUT("\r\n");
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is now that at the Chip_I2C_MasterRead() the programm blocks and dont do anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The real blocking is little deeper in the Chip_I2C_EventHandler(). The status stay always at I2C_STATUS_BUSY.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
void Chip_I2C_EventHandler(I2C_ID_T id, I2C_EVENT_T event)
{
struct i2c_interface *iic = &amp;amp;i2c[id];
volatile I2C_STATUS_T *stat;

/* Only WAIT event needs to be handled */
if (event != I2C_EVENT_WAIT) {
return;
}

stat = &amp;amp;iic-&amp;gt;mXfer-&amp;gt;status;
/* Wait for the status to change */
while (*stat == I2C_STATUS_BUSY) {}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas why the example code isnt working at me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are there any issues at the LPCopen I2C library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any informations&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:15:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575788#M19308</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: [solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575789#M19309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by drobe011 on Thu Apr 21 05:23:41 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe I had a similar problem when I used to use the board support package.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check the board.c file on lines 275 and 276 in the void Board_I2C_Init(I2C_ID_T id) function where it sets the pin function and mode.&amp;nbsp; It was incorrect (and still is).&amp;nbsp; It incorrectly sets the pins to Reserved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;275 and 276 should read:&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;Chip_IOCON_PinMux(LPC_IOCON, 0, 19, IOCON_MODE_INACT, IOCON_FUNC3);
Chip_IOCON_PinMux(LPC_IOCON, 0, 20, IOCON_MODE_INACT, IOCON_FUNC3);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not:&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;Chip_IOCON_PinMux(LPC_IOCON, 0, 19, IOCON_MODE_INACT, IOCON_FUNC2);
Chip_IOCON_PinMux(LPC_IOCON, 0, 20, IOCON_MODE_INACT, IOCON_FUNC2);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can check it out it the user manual (UM10360) page 117 in para 8.5.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That was my problem anyways.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:15:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575789#M19309</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: [solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575790#M19310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Thu Apr 21 08:01:27 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Could be useful to read:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc1769-i2c-not-working" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/lpc1769-i2c-not-working&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:15:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575790#M19310</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: [solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575791#M19311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mos87 on Thu Apr 21 15:26:33 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;THANKS!!!!!!!!!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now it is working. But why there is a known bug which is not fixed....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i always have to look for bugs befor i can use some lpcopen driver ... not what i expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:15:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575791#M19311</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: [solved] Problem with I2C example from LPCopen with LPCXpresso 1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575792#M19312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bump&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2016 01:08:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Problem-with-I2C-example-from-LPCopen-with-LPCXpresso/m-p/575792#M19312</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-19T01:08:40Z</dc:date>
    </item>
  </channel>
</rss>

