<?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 read/write with LPC1343 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865577#M34522</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please point what to modify exactly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jan 2019 12:32:37 GMT</pubDate>
    <dc:creator>nxp87999</dc:creator>
    <dc:date>2019-01-30T12:32:37Z</dc:date>
    <item>
      <title>I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865573#M34518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with a colleague on a personal project, a home-made bluetooth speaker powered by NXP microcontroller LPC1343 and TFA98xx Audio Amplifier, together with a BT module by Qualcomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The application is quite simple: the BT module provides I2S signals to the amplifier, LPC uC takes care of initializing it from I2C interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are facing some problems to make the I2C reading/writing working. We are using MCUXpresso 10.2.1, we loaded the LPCOpen library fror LPC1343 (lpcopen_2_05_lpcxpresso_nxp_lpcxpresso_1343.zip) and we used the example "periph_i2c" as starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The I2C pins 14 (PIO0.4/SCL) and 15 (PIO0.5/SDA) don't show any kind of activity, we tried several boards and measured with an oscilloscope, they seem stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our goal at the moment is to read and write one I2C register of the TFA, for example register 0x3. If we will manage to do that, we could proceed with the rest, it will be pretty straight-forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We would like to have an example of main(), to replace the one of the LPCOpen example, able to initialize I2C bus with 400kHz speed, read the 16 bits of TFA register 0x3 and write the same register 0x3 with other 16 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2C address of TFA98xx slave device is 0x34&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My colleague will provide tomorrow the source code we are trying to use, without success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2019 19:59:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865573#M34518</guid>
      <dc:creator>nxp87999</dc:creator>
      <dc:date>2019-01-28T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865574#M34519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the pull-up resistors present on the I2C lines? These are open collector en without those resistors you won't see any signal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2019 22:29:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865574#M34519</guid>
      <dc:creator>sergedemaseneer</dc:creator>
      <dc:date>2019-01-28T22:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865575#M34520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am the colleague of Dario working on this project, we used the following code to test:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;STRONG&gt;main&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;int&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; tmp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;int&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; xflag = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;static&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: small; "&gt;I2C_XFER_T&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; xfer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* Generic Initialization */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SystemCoreClockUpdate();&lt;/P&gt;&lt;P&gt;Board_Init();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; i2c_app_init(&lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;I2C0&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;, SPEED_100KHZ);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* Simulate an EEPROM slave in I2C0 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;i2c_eeprom_init(I2C_EEPROM_BUS);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;slaveAddr&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = 0x34;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxBuff&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;txBuff&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;txSz&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxSz&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; tmp = Chip_I2C_MasterRead(i2cDev, xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;slaveAddr&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;, xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxBuff&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;, xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxSz&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;return&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I2C pull-up resistors are in place but we still cannot see any activity on the&amp;nbsp;I2C lines , any idea ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp; about this i2c_eeprom_init(I2C_EEPROM_BUS); this is used for EEPROM read&amp;nbsp; as follows ,&lt;/P&gt;&lt;P&gt;I just modified &lt;SPAN style="font-size: small;"&gt;I2C_SLAVE_EEPROM_ADDR to be our TFA98XX address, anything else must be also changed&amp;nbsp;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;static&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;STRONG&gt;i2c_eeprom_init&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: small; "&gt;I2C_ID_T&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; id)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #642880; font-size: small; "&gt;memset&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;(&amp;amp;seep_data[1], 0xFF, I2C_SLAVE_EEPROM_SIZE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; seep_xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;slaveAddr&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = (I2C_SLAVE_EEPROM_ADDR &amp;lt;&amp;lt; 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; seep_xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;txBuff&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = &amp;amp;seep_data[1];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; seep_xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxBuff&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = seep_data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; seep_xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;txSz&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = seep_xfer.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small; "&gt;rxSz&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;sizeof&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;(seep_data);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; Chip_I2C_SlaveSetup(id, &lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;I2C_SLAVE_0&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;, &amp;amp;seep_xfer, i2c_eeprom_events, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Mehdi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:47:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865575#M34520</guid>
      <dc:creator>nxf07303</dc:creator>
      <dc:date>2019-01-29T10:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865576#M34521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The size of the transmit buffer is 0. But you need to transmit the address of the I2C slave. The processor stores the slave address in the tx buffer.&lt;/P&gt;&lt;P&gt;It is not the first time that this issue is raised here, to my understanding NXP should clarify this in the LPCopen documentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 20:40:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865576#M34521</guid>
      <dc:creator>sergedemaseneer</dc:creator>
      <dc:date>2019-01-29T20:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865577#M34522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please point what to modify exactly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2019 12:32:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865577#M34522</guid>
      <dc:creator>nxp87999</dc:creator>
      <dc:date>2019-01-30T12:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read/write with LPC1343</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865578#M34523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should point you to older discussions on this forum like &lt;A href="https://community.nxp.com/thread/423084"&gt;I2C on LPC1343&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The I2C samples are in general poorly written (Even old NXP employees say "eek") and the comments sometimes don't even match the software. So i thought it better to point you to the old discussions we had here some years ago. If you want a working example then i can point you to the website of Rob65 (old NXP employee who was active on this forum but stopped some years ago). The example is written for the LPC11xx but should show you how to write your own drivers. The website: &lt;A class="link-titled" href="http://myvoice.nl/software/" title="http://myvoice.nl/software/"&gt;MyVoice CAD/CAM Services - Free Software Projects&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Serge&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2019 16:16:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/I2C-read-write-with-LPC1343/m-p/865578#M34523</guid>
      <dc:creator>sergedemaseneer</dc:creator>
      <dc:date>2019-01-30T16:16:33Z</dc:date>
    </item>
  </channel>
</rss>

