<?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_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69828/i2c_burst_write-difference-nrf52-and-nrf91-series</link><description>Dear All, I&amp;#39;m using Zephyr to configure a nrf9160 as I2C master and the OPT3002 light sensor as I2C slave. The OPT3002 has a 16bit configuration register, which I need to write to. For this I use i2c_burst_write(), which works fine on the nrf52 series</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Feb 2021 12:40:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69828/i2c_burst_write-difference-nrf52-and-nrf91-series" /><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/292667?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 12:40:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:953a75c0-9c8a-4750-bba7-eeb3af8f14a3</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I looked into this, and got a better overview of what&amp;#39;s going on.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;When writing to a register, the following should appear on the SDA line:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Send start command&lt;/li&gt;
&lt;li&gt;Send 7 bit start address + write bit&lt;/li&gt;
&lt;li&gt;Send register address&lt;/li&gt;
&lt;li&gt;Send data to be written to the register&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You are trying to write&amp;nbsp;&lt;span&gt;0xC688 to the configuration register with address 0x01 of an I2C slave with address 0x88.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;What the nRF52840 does, based on the trace&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Send start command&lt;/li&gt;
&lt;li&gt;Send 7 bit start address&amp;nbsp;(0x88) + write bit&lt;/li&gt;
&lt;li&gt;Send register address&amp;nbsp;(0x01)&lt;/li&gt;
&lt;li&gt;Send data to be written to the register&amp;nbsp;(0xC6 + 0x08)&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;What the nRF9160 does, based on the trace&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Send start command&lt;/li&gt;
&lt;li&gt;Send 7 bit start address&amp;nbsp;(0x88) + write bit&lt;/li&gt;
&lt;li&gt;Send register address&amp;nbsp;(0x01)&lt;/li&gt;
&lt;li&gt;Send 7 bit start address&amp;nbsp;(0x88) + write bit
&lt;ul&gt;
&lt;li&gt;This is where it differs from the nrf52, it splits the message up in two pieces&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Send register address (0xC6)&lt;/li&gt;
&lt;li&gt;Send data to be written to the register&amp;nbsp;(0xC6 + 0x08)
&lt;ul&gt;
&lt;li&gt;This is&lt;span&gt;&amp;nbsp;&lt;/span&gt;why&lt;span&gt;&amp;nbsp;&lt;/span&gt;it fails, because this is not register 0x01&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Send data (0x08)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I suspect the issue is that for the nRF9160, the function&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twim.c#L46"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;i2c_nrfx_twim_transfer()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;does not concatenate the messages for some reason, and calls&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twim.c#L116"&gt;nrfx_twim_xfer()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;two times. I&amp;#39;m not sure why if this is the case.&lt;/p&gt;
&lt;p&gt;Could you try to do some debugging in the function&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twim.c#L46"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;i2c_nrfx_twim_transfer()&lt;/a&gt;, both when the nRF52840 is used, as well as the nRF9160. Check if&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twim.c#L116"&gt;nrfx_twim_xfer()&lt;/a&gt;&amp;nbsp;is called one or two times.&lt;/p&gt;
&lt;p&gt;By the way if&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;quot;nordic,nrf-twim&amp;quot; is set in the dts/overlay file,&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twim.c"&gt;i2c_nrfx_twim.c&lt;/a&gt;&amp;nbsp;will be used, and if&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;quot;nordic,nrf-twi&amp;quot; is set,&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/009b065f52ae8a07ab3265b022667c525fa62a9a/drivers/i2c/i2c_nrfx_twi.c"&gt;i2c_nrfx_twi.c&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;will be used&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/290657?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 07:53:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6545ef7d-de57-417b-bf6c-a059cc6e0406</guid><dc:creator>Maaike</dc:creator><description>&lt;p&gt;As expected using i2c_write instead of i2c_burst_write solved my problem. &lt;br /&gt;I do still wonder why i2c_burst_write does not work on the nRF91 and it does work on the nRF52. &lt;/p&gt;
&lt;p&gt;Kind regards, &lt;br /&gt;Maaike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/289634?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 08:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2020a73-5ec8-4948-b256-1a10db56a6a5</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Have you gotten any progress on this? &lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/25867"&gt;Pull request&amp;nbsp;25867&lt;/a&gt;&amp;nbsp;may be helpful, it&amp;nbsp;adds an option to concat smaller payloads.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/287723?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 13:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cbf1a20-8710-4497-9aaa-5e9bfd527bd6</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Sorry for the delay on this. I&amp;#39;m back at work and will look into this case.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/286800?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2020 09:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6f05e44-5047-4b46-ac79-00baf187da6d</guid><dc:creator>Maaike</dc:creator><description>&lt;p&gt;I was able to check it with the logic analyser and there is a difference between the nrf52 and nrf91 in writing to the configuration register. In the reading of the ID register there is no difference. &lt;br /&gt;&lt;br /&gt;Some addresses and values:&lt;br /&gt;I2C address read =&amp;nbsp; 0x44&lt;br /&gt;I2C address write = 0xC4&lt;br /&gt;MANUFACTURER_ID register address =&amp;nbsp; 0x7E&lt;br /&gt;CONFIGURATION register address = 0x01&lt;br /&gt;MANUFACTURER_ID = 0x5449&lt;br /&gt;Configuration value to write = 0b1100011xxxx01000, where x are read only fields. &lt;br /&gt;Expected configuration value to read = 0xC688&amp;nbsp; (0b1100011010001000)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below the read ID register and the write and read to the configuration register of both the nrf91 and nrf52 are posted. &lt;br /&gt;&lt;br /&gt;nrf91 read ID register&lt;br /&gt;&lt;img alt="nrf91 reading ID register" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf91_5F00_read_5F00_ID_5F00_reg.png" /&gt;&lt;br /&gt;&lt;br /&gt;nrf52 read ID register&lt;br /&gt;&lt;img alt="nrf52 read ID register" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf52_5F00_read_5F00_ID_5F00_reg.png" /&gt;&lt;br /&gt;&lt;br /&gt;nrf91 write read configuration register&lt;br /&gt;&lt;img alt="nrf91 write read configuration register" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf91_5F00_write_5F00_read_5F00_conf_5F00_reg.png" /&gt;&lt;br /&gt;&lt;br /&gt;nrf52 write read configuration register&lt;br /&gt;&lt;img alt="nrf52 write read configuration register" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf52_5F00_write_5F00_read_5F00_conf_5F00_reg.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/286521?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 00:30:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66be72c2-bfb3-4217-a93f-9b93d9b7926a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;A huge part of the support team are currently on Christmas vacaction, and you may experience delayed answers. Most of the staff will be back by january 4th and you can expect an answer after then. My apologies for this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/286473?ContentTypeID=1</link><pubDate>Wed, 23 Dec 2020 13:36:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dced9b5-d1e4-4618-b243-0baf8263f123</guid><dc:creator>Maaike</dc:creator><description>&lt;p&gt;Hi Simon,&lt;br /&gt;&lt;br /&gt;I will check the i2c output with the logic analyser. &lt;br /&gt; Due to the Christmas holidays it might take a week (or 2) till I can get back to you with the results.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Have a good holiday!&lt;br /&gt;Kind regards,&lt;br /&gt;Maaike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_burst_write difference nrf52 and nrf91 series</title><link>https://devzone.nordicsemi.com/thread/286459?ContentTypeID=1</link><pubDate>Wed, 23 Dec 2020 12:52:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a087396a-1759-419b-a389-4084d5a96839</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Could you try to attach a logic analyzer to the I2C pins and see if the output differs between the nRF52 and the nRF91 when you use the i2c_burst_write function. That would be interesting to see. I&amp;#39;ll soon take christmas vacation for some days, so I don&amp;#39;t have time to do it myself before then.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>