<?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>How to set I2C slave address?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77801/how-to-set-i2c-slave-address</link><description>Hi, 
 
 I&amp;#39;m considering using NRF52832/52840 as BLE central while configuring its I2C as slave. 
 Should I initialize I2C with TWIS instance? How do I suppose to set the slave address? 
 I&amp;#39;ve check the &amp;quot;twi_master_with_twis_slave&amp;quot; sample of SDK16. But</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Aug 2021 07:48:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77801/how-to-set-i2c-slave-address" /><item><title>RE: How to set I2C slave address?</title><link>https://devzone.nordicsemi.com/thread/323231?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 07:48:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b9957e9-1562-4d03-a8a0-60887c4e1f1d</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Thanks Jared!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set I2C slave address?</title><link>https://devzone.nordicsemi.com/thread/323226?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 07:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49365d36-7819-4102-8e3e-7c9c82e37e68</guid><dc:creator>Jared</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;li&gt;Correct&lt;/li&gt;
&lt;li&gt;Correct&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I suggest reading the documentation for the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/hardware_driver_twis_slave.html?cp=8_1_2_0_18"&gt;driver&lt;/a&gt;&amp;nbsp;and the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twis.html?cp=4_2_0_33#concept_agw_dtf_wr"&gt;peripheral&lt;/a&gt;. I also recommend that you try the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/twi_scanner_example.html?cp=8_1_4_6_42"&gt;twi_scanner&lt;/a&gt;&amp;nbsp;example and probe the SCL and SDA line with either an oscilloscope or a logical analyzer. I think it would help you understand how the driver works.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set I2C slave address?</title><link>https://devzone.nordicsemi.com/thread/323203?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 04:36:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f39f59a9-2f33-408e-8dd7-c0186f3df0b8</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry for late reply, I&amp;#39;ve been working on TWI and TWIS communication.&lt;/p&gt;
&lt;p&gt;Here are few more points I wish to confirm:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When &amp;quot;nrf_drv_twi_tx&amp;quot; processed,&amp;nbsp; slave &amp;quot;TWIS_EVT_WRITE_REQ&amp;quot; will be called.&lt;/li&gt;
&lt;li&gt;When slave address is set to 0x10, I don&amp;#39;t have to implement the address to fit read/write application since&amp;nbsp;&lt;span&gt;nrf_drv_twi_tx/nrf_drv_twi_rx will fill the last bit automatically&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;ACK bit will be sent automatically by slave&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set I2C slave address?</title><link>https://devzone.nordicsemi.com/thread/321719?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 08:05:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e58676e-3041-4166-8081-d72ee9094c65</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Should I initialize I2C with TWIS instance?[/quote]
&lt;p&gt;&amp;nbsp;Yes&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]How do I suppose to set the slave address[/quote]
&lt;p&gt;&amp;nbsp;The slave address should be sent to the master after the master sends a read request. The read request event&amp;nbsp;TWIS_EVT_READ_REQ is then generated. The TWIM with eeprom shows how this should be done in the eeprom_simulator.c file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;If I were use several NRF52s as slaves, how do I suppose to set each address? Does the 7 bits fully customizable?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes almost. There are some reserved addresses but other than that, you can pretty much set it to what you like.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;Perhaps I just need to implement this part to initialize TWIS?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="overflow:auto;"&gt;&lt;div&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;&amp;nbsp;That&amp;#39;s enough to initialize it but you have to implement a callback handler that reacts to requests from the Master etc.&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>