<?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>LPCXpresso IDEのトピックLPC1769: I2C sends wrong address</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-I2C-sends-wrong-address/m-p/531159#M2355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by SplasH on Fri Mar 15 07:59:57 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with the lpc1769's i2c-bus. I have connected an IMU with mpu6050 and hmc5883l (FreeIMU) to my LPCXpresso board. I use the nxp driver library and my self-written library for the imu. But I have a problem with the i2c communication. It seems like the slave address sometimes isn't send correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_M_SETUP_Type transfer_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t rx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t tx_data;

&amp;nbsp;&amp;nbsp;&amp;nbsp; //Registerstatus auslesen
&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_data = HMC5883_ID_A;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //defined as 0x0A

&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.sl_addr7bit = HMC5883_ADDRESS;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //#define as 0x1E
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.tx_data = &amp;amp;tx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.tx_length = 1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.rx_length = 1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.rx_data = &amp;amp;rx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.retransmissions_max = 3;

&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t status = I2C_MasterTransferData(i2c_bus, &amp;amp;transfer_data, I2C_TRANSFER_POLLING);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;In most cases with "retransmissions_max" set to 3 the status returned by the i2c-function is ok. But if I set it to 0 everytime it returns "ERROR". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached you can find two screenshots from a logic analyzer. The first screen shows the behaviour with the code above. Sometimes a start condition and the correct address is send, but no data is read. Also it's possible that a wrong address is send. You can also see the correct sequence:&amp;nbsp; Start + 1E (write), Restart + 1E (read) and the databyte 0x42.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second screen shows some readings of the mpu6050 (address 0x69). Here you can see that there are attempts to write to an address which doesn't exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What could be the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:06:44 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:06:44Z</dc:date>
    <item>
      <title>LPC1769: I2C sends wrong address</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-I2C-sends-wrong-address/m-p/531159#M2355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by SplasH on Fri Mar 15 07:59:57 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with the lpc1769's i2c-bus. I have connected an IMU with mpu6050 and hmc5883l (FreeIMU) to my LPCXpresso board. I use the nxp driver library and my self-written library for the imu. But I have a problem with the i2c communication. It seems like the slave address sometimes isn't send correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_M_SETUP_Type transfer_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t rx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t tx_data;

&amp;nbsp;&amp;nbsp;&amp;nbsp; //Registerstatus auslesen
&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_data = HMC5883_ID_A;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //defined as 0x0A

&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.sl_addr7bit = HMC5883_ADDRESS;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //#define as 0x1E
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.tx_data = &amp;amp;tx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.tx_length = 1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.rx_length = 1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.rx_data = &amp;amp;rx_data;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer_data.retransmissions_max = 3;

&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t status = I2C_MasterTransferData(i2c_bus, &amp;amp;transfer_data, I2C_TRANSFER_POLLING);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;In most cases with "retransmissions_max" set to 3 the status returned by the i2c-function is ok. But if I set it to 0 everytime it returns "ERROR". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached you can find two screenshots from a logic analyzer. The first screen shows the behaviour with the code above. Sometimes a start condition and the correct address is send, but no data is read. Also it's possible that a wrong address is send. You can also see the correct sequence:&amp;nbsp; Start + 1E (write), Restart + 1E (read) and the databyte 0x42.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second screen shows some readings of the mpu6050 (address 0x69). Here you can see that there are attempts to write to an address which doesn't exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What could be the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:06:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-I2C-sends-wrong-address/m-p/531159#M2355</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:06:44Z</dc:date>
    </item>
  </channel>
</rss>

