<?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 communication with two NRF DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119797/i2c-communication-with-two-nrf-dk</link><description>Hi, 
 
 I want to make an I2C communication with an NRF5340 DK as Master and an NRF52840 as Slave, but all the example i found in I2C communication it use the slave adress to communicate, 
 But i don&amp;#39;t know my NRF52840 DK I2C adress, is there a way to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Mar 2025 13:59:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119797/i2c-communication-with-two-nrf-dk" /><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527664?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 13:59:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e968be4-2535-4d13-b981-6ec8e0ad83d5</guid><dc:creator>D.MASSIALA</dc:creator><description>&lt;p&gt;i used the example given in the github link that you give and it&amp;#39;s working :&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.9.1/tests/benchmarks/i2c_endless"&gt;https://github.com/nrfconnect/sdk-nrf/tree/v2.9.1/tests/benchmarks/i2c_endless&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;thank you for your help&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527563?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 10:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f70c06e-ad2b-436d-b495-464dd879e079</guid><dc:creator>Priyanka</dc:creator><description>[quote user=""]But i don&amp;#39;t know my NRF52840 DK I2C adress, is there a way to make this communication possible ?&amp;nbsp;[/quote]
&lt;p&gt;There is no particular address and you can select any address which is not being used by any other peripheral/register.&lt;/p&gt;
&lt;p&gt;Also,&lt;/p&gt;
&lt;p&gt;could you try to set the &lt;strong&gt;compatible = &amp;quot;nordic,nrf-twim&amp;quot;;&lt;/strong&gt; for the slave?&amp;nbsp;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I would suggest you to define them according to&amp;nbsp; this:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.overlay#L61"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/tests/benchmarks/i2c_endless/boards/nrf52840dk_nrf52840.overlay#L61&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527324?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 08:18:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d59740cc-41c3-4e47-95af-1dc9bf477f94</guid><dc:creator>D.MASSIALA</dc:creator><description>&lt;p&gt;To resume my code :&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I try to put my NRF5340 DK as a Slave using the adress 0x77 and my NRF52840 as Master.&lt;/p&gt;
&lt;p&gt;And after i try to read my NRF5340 Adress to be sure connection is ok but it doesn&amp;#39;t work :&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
Failed to read from I2C device address&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527323?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 08:10:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0dac2df-f5ae-4401-a7fb-6e664f488d12</guid><dc:creator>D.MASSIALA</dc:creator><description>&lt;p&gt;For the master config i have this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;prj.conf :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2016 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

# STEP 2 - Enable the I2C driver
CONFIG_I2C=y
# STEP 4.2 - Enable floating point format specifiers
CONFIG_CBPRINTF_FP_SUPPORT=y

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my overlay:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html

&amp;amp;i2c0 {
    status = &amp;quot;okay&amp;quot;;
    pinctrl-0 = &amp;lt;&amp;amp;i2c0_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
    mysensor: mysensor@77{
        compatible = &amp;quot;i2c-device&amp;quot;;
        status = &amp;quot;okay&amp;quot;;
        reg = &amp;lt; 0x77 &amp;gt;;
    };
};

&amp;amp;pinctrl {
	/omit-if-no-ref/ i2c0_default: i2c0_default {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 1, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;;
		};
	};

	/omit-if-no-ref/ i2c0_sleep: i2c0_sleep {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 1, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
/* STEP 3 - Include the header file of the I2C API */
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;
/* STEP 4.1 - Include the header file of printk() */
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000

/* STEP 6 - Get the node identifier of the sensor */
#define I2C_NODE DT_NODELABEL(mysensor)





int main(void)
{
	static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C_NODE);

	if (!device_is_ready(dev_i2c.bus)) {
		printk(&amp;quot;I2C bus %s is not ready!\n&amp;quot;, dev_i2c.bus-&amp;gt;name);
		return -1;
	}

	

	uint8_t data;
	int ret = i2c_read_dt(&amp;amp;dev_i2c, &amp;amp;data, sizeof(data));
	if(ret != 0){
		printk(&amp;quot;Failed to read from I2C device address&amp;quot;);
	}


}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527321?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 08:07:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8f8670b-f225-48ed-b512-ef7183e0d22a</guid><dc:creator>D.MASSIALA</dc:creator><description>&lt;p&gt;There is some details of my code for the Slave configuration :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my prj.conf :&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2016 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

# STEP 2 - Enable the I2C driver
CONFIG_I2C=y
# STEP 4.2 - Enable floating point format specifiers
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_I2C_NRFX=y
CONFIG_NRFX_TWIS0=y&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;--------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;my overlay :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;// To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html

&amp;amp;i2c1 {
    status = &amp;quot;okay&amp;quot;;
    pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
    mysensor: mysensor@77{
        compatible = &amp;quot;i2c-device&amp;quot;;
        status = &amp;quot;okay&amp;quot;;
        reg = &amp;lt; 0x77 &amp;gt;;
    };
};

&amp;amp;pinctrl {
	/omit-if-no-ref/ i2c1_default: i2c1_default {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 1, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;;
		};
	};

	/omit-if-no-ref/ i2c1_sleep: i2c1_sleep {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 1, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;-------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;my main.c&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
/* STEP 3 - Include the header file of the I2C API */
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;
/* STEP 4.1 - Include the header file of printk() */
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000

/* STEP 8 - Define the addresses of relevant registers */


/* STEP 6 - Get the node identifier of the sensor */
#define I2C_NODE DT_NODELABEL(mysensor)


int main(void)
{

	/* STEP 7 - Retrieve the API-specific device structure and make sure that the device is
	 * ready to use  */
	static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C_NODE);

	if (!device_is_ready(dev_i2c.bus)) {
		printk(&amp;quot;I2C bus %s is not ready!\n&amp;quot;, dev_i2c.bus-&amp;gt;name);
		return -1;
	}

	return 0;
}
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication with two NRF DK</title><link>https://devzone.nordicsemi.com/thread/527317?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 07:59:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c29bc76c-0226-4254-af90-581c9fefc8ee</guid><dc:creator>D.MASSIALA</dc:creator><description>&lt;p&gt;After some research i found this post which say that i can put my NRF52840 as a slave adding this line on prj.conf&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_I2C_NRFX&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NRFX_TWIS0&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/107048/configuring-52832-for-i2c-slave-mode-using-zephyr-and-vs-code"&gt;Configuring 52832 for I2C slave mode using zephyr and VS code&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i try but it doesn&amp;#39;t work&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>