<?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 LPC1788 - Reading a slave registers in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544117#M12831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two kinds of people: Those like you and me who understand the original Philips I2C specification (&lt;A href="http://www.nxp.com/documents/user_manual/UM10204.pdf" title="http://www.nxp.com/documents/user_manual/UM10204.pdf"&gt;http://www.nxp.com/documents/user_manual/UM10204.pdf&lt;/A&gt;​), and those who don't...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The I2C spec defines a 7-bit address space 0x00...0x7F in steps of one. In this world the address of your device is 0x38.&lt;/P&gt;&lt;P&gt;However, the address byte sent on the bus has the 7-bit slave address field shifted left by one bit (bits 7:1), with bit 0 indicating read/write operation. Now some prefer to treat the address byte as the slave address, so they get 0x00...0xFE in steps of two, and your slave address becomes 0x70.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will find both interpretations in data sheets, and some trial and error is often involved to get it right.&lt;/P&gt;&lt;P&gt;(edited to get the example right...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jul 2016 14:53:58 GMT</pubDate>
    <dc:creator>rolfmeeser</dc:creator>
    <dc:date>2016-07-07T14:53:58Z</dc:date>
    <item>
      <title>I2C LPC1788 - Reading a slave registers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544114#M12828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all of you,&lt;/P&gt;&lt;P&gt;I'm using I2C to control a touch panel with LPC1788 used as master. I'm using LPCOpen driver to gain time.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TouchPanel Iitialization&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pin muxing I2C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_I2C_Init&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_I2C_SetClockRate // 100000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Board_I2C_SetMod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Pooling mode&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The touch panel contain many register (page 6 - &lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.mouser.com%2Fds%2F2%2F291%2FNHD-4.3-480272EF-ATXL-CTP-28216.pdf" rel="nofollow" target="_blank"&gt;http://www.mouser.com/ds/2/291/NHD-4.3-480272EF-ATXL-CTP-28216.pdf&lt;/A&gt; -).&lt;/P&gt;&lt;P&gt;First of all I want to read or write one of this register on the slave, but the broblem is when I prob SDL SCA with a serial decode I capture only the Address 0x70 in read or write. It seems that the data and the Register Slave Adress isn't send.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this command to Send Data: Chip_I2C_MasterSend(BOARD_CTP_ID, CTP_ADDR, buf, 3);&lt;/P&gt;&lt;P&gt;The buf contain at 0 the register Adresse then from buf[1] it contain the data I want to write.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case of Read I use Chip_I2C_MasterRead(BOARD_CTP_ID, FT5336_I2C_SLAVE_ADDRESS, &amp;amp;buf[2], 1);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct way to use a Read Slave Register, and Write Value in Slave Register?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 07:44:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544114#M12828</guid>
      <dc:creator>abderrezak</dc:creator>
      <dc:date>2016-07-07T07:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: I2C LPC1788 - Reading a slave registers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544115#M12829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The scope traces show your request is NAK'ed (no response from the slave device).&lt;/P&gt;&lt;P&gt;It may be a case of a shifted slave address: Try specifying 0x38 instead of 0x70 as the address.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:27:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544115#M12829</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-07-07T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: I2C LPC1788 - Reading a slave registers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544116#M12830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Worked&lt;/P&gt;&lt;P&gt;Can you explain to me this thing about slave shifted addresses or give me some doc &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:50:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544116#M12830</guid>
      <dc:creator>abderrezak</dc:creator>
      <dc:date>2016-07-07T13:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: I2C LPC1788 - Reading a slave registers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544117#M12831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two kinds of people: Those like you and me who understand the original Philips I2C specification (&lt;A href="http://www.nxp.com/documents/user_manual/UM10204.pdf" title="http://www.nxp.com/documents/user_manual/UM10204.pdf"&gt;http://www.nxp.com/documents/user_manual/UM10204.pdf&lt;/A&gt;​), and those who don't...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The I2C spec defines a 7-bit address space 0x00...0x7F in steps of one. In this world the address of your device is 0x38.&lt;/P&gt;&lt;P&gt;However, the address byte sent on the bus has the 7-bit slave address field shifted left by one bit (bits 7:1), with bit 0 indicating read/write operation. Now some prefer to treat the address byte as the slave address, so they get 0x00...0xFE in steps of two, and your slave address becomes 0x70.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will find both interpretations in data sheets, and some trial and error is often involved to get it right.&lt;/P&gt;&lt;P&gt;(edited to get the example right...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 14:53:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-LPC1788-Reading-a-slave-registers/m-p/544117#M12831</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-07-07T14:53:58Z</dc:date>
    </item>
  </channel>
</rss>

