<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>I2C reads/writes: How to communicate with a 7bit I2C slave that has a 16bit memory map?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81811/i2c-reads-writes-how-to-communicate-with-a-7bit-i2c-slave-that-has-a-16bit-memory-map</link><description>I am working with a sensor IC (IQS572) that communicates via I2C with my main microcontroller. Im using the nRF52382 chip. This sensor IC has a 7bit I2C slave address, but all of its internal registers that I want to read/write from have 16bit (2 byte</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Nov 2021 23:19:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81811/i2c-reads-writes-how-to-communicate-with-a-7bit-i2c-slave-that-has-a-16bit-memory-map" /><item><title>RE: I2C reads/writes: How to communicate with a 7bit I2C slave that has a 16bit memory map?</title><link>https://devzone.nordicsemi.com/thread/339720?ContentTypeID=1</link><pubDate>Thu, 18 Nov 2021 23:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79de61ef-583d-4704-b56a-536505584a42</guid><dc:creator>cor10</dc:creator><description>&lt;p&gt;Hi Jared. I had initially started with that commented out approach, but&amp;nbsp;moved to the uncommented approach above because it wasnt working at first. I now realize I had a very small&amp;nbsp;bug that was a result of copy/pasting the function skeleton from my previous 8bit implementation. For anyone looking at this post, the bug was in the line&amp;nbsp;&lt;em&gt;&lt;strong&gt;&lt;span&gt;nrf_drv_twi_xfer_desc_t xfer = NRF_DRV_TWI_XFER_DESC_TX(slaveAddr, buffer, length + 1);&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt; where I was inputting&amp;nbsp;&lt;em&gt;&lt;strong&gt;length + 1&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;erroneously instead of&amp;nbsp;&lt;em&gt;&lt;strong&gt;length +2&lt;/strong&gt;&lt;/em&gt; to account for the 2bytes of the 16bit register address instead of just the 1byte for the 8bit register addresses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C reads/writes: How to communicate with a 7bit I2C slave that has a 16bit memory map?</title><link>https://devzone.nordicsemi.com/thread/339493?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 16:01:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e219ee2f-4148-4ad8-b9d1-22dc1aae2e1e</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;The write code that is commented out looks ok. Could you try that one? I think the secondary buffer are ignored on a normal TX.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>