<?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>Setting up a MP8862 with i2c</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84058/setting-up-a-mp8862-with-i2c</link><description>Hey devs, 
 I&amp;#39;m trying to get the i2c interface to work with the MP8862. I followed the TWIS driver guide to get started and in there everything worked. 
 Now I wanted to setup the sensor and thus changed my overlay file to: 
 
 I just used the i2c to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jan 2022 11:34:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84058/setting-up-a-mp8862-with-i2c" /><item><title>RE: Setting up a MP8862 with i2c</title><link>https://devzone.nordicsemi.com/thread/349949?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 11:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32126479-d5db-4fd1-a077-96ee591c58e5</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I would not recommend you to&amp;nbsp;mix the Zephyr layer and the nrfx layer (the Zephyr layer will use the nrfx layers under the hood). The zephyr api will get information about the I2C configuration from dts (e.g. overlay) and Kconfig (e.g. prj.conf), and the nrfx layer will not. I have gone more into details about the NRFX/Zephyr layer in this answer:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70627/what-s-the-official-way-to-implement-a-simple-peripheral-spi-i2c-etc-with-ncs/290247#290247"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/70627/what-s-the-official-way-to-implement-a-simple-peripheral-spi-i2c-etc-with-ncs/290247#290247&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By the way, here is a sample that demonstrates how to use the NRFX API:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/d9cc0d37bf45a544ccc7bb0df159d470b836724d/samples/boards/nrf/nrfx"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/d9cc0d37bf45a544ccc7bb0df159d470b836724d/samples/boards/nrf/nrfx&lt;/a&gt;&amp;nbsp;&amp;nbsp;&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: Setting up a MP8862 with i2c</title><link>https://devzone.nordicsemi.com/thread/349933?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 11:00:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23b19aa6-cc6d-456f-b3b3-9279eb484f50</guid><dc:creator>J Boumans</dc:creator><description>&lt;p&gt;I tried to used the i2c_nrfx_twim_transfer() to send the data, but it is undefined. I included nrfx_twim.h and enabled it in the conf with&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;config_nrfx_twim=y&lt;/pre&gt;.&lt;/p&gt;
&lt;p&gt;How should I include it?&lt;/p&gt;
&lt;p&gt;Indeed the address for my testing setup was off. I did not yet have time to test this with the correct setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting up a MP8862 with i2c</title><link>https://devzone.nordicsemi.com/thread/349772?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 13:35:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:817c6eb7-014e-469a-85b5-1edc13f92ed6</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I guess it is the function &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/e0b8c6a30c7831600c52cabf34898e8f9fd03958/include/drivers/i2c.h#L771"&gt;i2c_write()&lt;/a&gt; you&amp;#39;re running that is causing it to fault. That function should be coupled with &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/e0b8c6a30c7831600c52cabf34898e8f9fd03958/drivers/i2c/i2c_nrfx_twim.c#L45"&gt;i2c_nrfx_twim_transfer()&lt;/a&gt;,&amp;nbsp;which will run&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/e0b8c6a30c7831600c52cabf34898e8f9fd03958/drivers/i2c/i2c_nrfx_twim.c#L141"&gt;nrfx_twim_xfer()&lt;/a&gt;. The function nrfx_twim_xfer() has the following return types:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/blob/8f013ea950f41bf69b18bf688bfb0dd80a3fdc44/nrfx/drivers/include/nrfx_twim.h#L299-L306"&gt;https://github.com/nrfconnect/sdk-hal_nordic/blob/8f013ea950f41bf69b18bf688bfb0dd80a3fdc44/nrfx/drivers/include/nrfx_twim.h#L299-L306&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you take a look at&amp;nbsp;modules\hal\nordic\nrfx\drivers\nrfx_errors.h, the error 0x0BAE0001 evaluates to&amp;nbsp;NRFX_ERROR_DRV_TWI_ERR_ANACK. That error means that &lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/blob/8f013ea950f41bf69b18bf688bfb0dd80a3fdc44/nrfx/drivers/include/nrfx_twim.h#L305"&gt;a NACK is received after sending the address&lt;/a&gt;, so the address you&amp;#39;re sending is not acknowledge by the&amp;nbsp;MP8862. I can see that you have set the address to&amp;nbsp;0x6b, is that the correct one? Doublecheck the datasheet, and maybe check the lines using a logic analyzer to see what is actually sent.&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>