<?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>nrf52840 with Arduino over I2C</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66261/nrf52840-with-arduino-over-i2c</link><description>Hello, 
 
 We are trying to set up communication between nrf52840 and Arduino UNO over I2C. 
 
 The challenge is we don&amp;#39;t know the slave address of the Arduino. 
 
 Anyone else has worked on this before please guide. 
 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Sep 2020 11:51:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66261/nrf52840-with-arduino-over-i2c" /><item><title>RE: nrf52840 with Arduino over I2C</title><link>https://devzone.nordicsemi.com/thread/271318?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 11:51:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a0a73cd-5ff5-4b38-a2ff-d4e25fe8453a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="nshah88"]This is working. We are able to get the Slave address via the TWI scan example.[/quote]
&lt;p&gt;Great, I am happy to hear that you are able to find the slave address of your connected device.&lt;br /&gt;This means that the connection is correct, and the configuration of the connected device as a slave device is correct.&lt;/p&gt;
[quote user="nshah88"]One more question though: What should be passed in the first argument of nrf_drv_twi_tx? The argument requires: nrf_drv_twi_t const * p_instance?[/quote]
&lt;p&gt;For the first argument of the function, you should pass your twi instance. You can see this being created at the very start of the example, in the line:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The TWI instance allocates memory to your TWI instance. You will need to pass this as an argument to most ( if not&amp;nbsp;&lt;em&gt;all&lt;/em&gt; ) the driver functions.&lt;br /&gt;&lt;br /&gt;Lastly, as a side note, I recommend that you move to using the nrfx_twim driver directly, instead of using the legacy nrf_drv driver.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 with Arduino over I2C</title><link>https://devzone.nordicsemi.com/thread/271258?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 08:44:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ddcac53-1653-4e49-856d-32c24b412a23</guid><dc:creator>Neel</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/66261/nrf52840-with-arduino-over-i2c/271145"]As described in the example documentation, the nRF will output the results of the TWI bus scan to the terminal, where your Arduino device then should show up - if it is connected correctly and configured as a TWI slave.[/quote]
&lt;p&gt;This is working. We are able to get the Slave address via the TWI scan example.&lt;/p&gt;
&lt;p&gt;One more question though: What should be passed in the first argument of nrf_drv_twi_tx? The argument requires: nrf_drv_twi_t const * p_instance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 with Arduino over I2C</title><link>https://devzone.nordicsemi.com/thread/271145?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 14:48:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:574c356d-b459-4786-bc49-d7dbf59539a9</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;As @Dmitry says - is your Arduino device configured as an TWI Slave device?&lt;br /&gt;Furthermore, could you attempt to run the unmodified &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/twi_scanner_example.html"&gt;TWI Scanner example&lt;/a&gt;&amp;nbsp;from the SDK while you are connected to your Arduino, and see if it is discoverable on the TWI bus?&lt;br /&gt;As described in the example documentation, the nRF will output the results of the TWI bus scan to the terminal, where your Arduino device then should show up - if it is connected correctly and configured as a TWI slave.&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 with Arduino over I2C</title><link>https://devzone.nordicsemi.com/thread/271005?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 08:32:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91b93fdf-81f2-498a-861e-8d9022be0abd</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;to configure Arduino as a slave, you need to pass its slave address to&amp;nbsp;&lt;a href="https://www.arduino.cc/en/Reference/WireBegin"&gt;Wire.begin()&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>