<?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>TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49316/twi-communication-between-two-nrf52-device</link><description>Hi, 
 I am trying to extablish TWI communication between 2 nRF52832 devices. One should be master and other slave. 
 For TWI initialization in nRF52 master, I have below source code: 
 void twi_init(void) { ret_code_t err; 
 const nrf_drv_twi_config_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jul 2019 18:33:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49316/twi-communication-between-two-nrf52-device" /><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/197217?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2019 18:33:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce63c674-7971-4f42-aa59-6041bb158d7b</guid><dc:creator>Anisa</dc:creator><description>&lt;p&gt;SCL and SDL pins were interchanged in my HW. Changing pin numbers worked!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/196779?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 09:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38d51ae1-8271-4931-a7be-4240a35b4a49</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Jolly Good.&lt;/p&gt;
&lt;p&gt;For the benefit of others who may find this with similar questions, please describe what was the issue (or issues) and how you solved it/them.&lt;/p&gt;
&lt;p&gt;And verify the answer:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0020._5F00_Verify_2D00_answer_2D00_nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/196715?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 06:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdc0e542-369c-439c-921b-85ea15357bb3</guid><dc:creator>Anisa</dc:creator><description>&lt;p&gt;I got it working. Thanks awneil.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/196419?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 08:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e73ffaae-59ce-4259-a789-0dc87ec40463</guid><dc:creator>awneil</dc:creator><description>[quote userid="81289" url="~/f/nordic-q-a/49316/twi-communication-between-two-nrf52-device/196393"]I verified that both nRF52 work as master and can detect another MCU on the I2C bus.[/quote]
&lt;p&gt;&lt;em&gt;detecting&lt;/em&gt;&amp;nbsp;a Slave is just the start!&lt;/p&gt;
&lt;p&gt;You have a long way to go from there before you have a fully-functional, usable Master implementation!&lt;/p&gt;
&lt;p&gt;Again:&lt;/p&gt;
[quote userid="6462" url="~/f/nordic-q-a/49316/twi-communication-between-two-nrf52-device/196292"]Make sure you&amp;nbsp;thoroughly test &amp;amp; debug&amp;nbsp;your Master to&amp;nbsp;cope with common problems&amp;nbsp;such as no ACK, unexpected NAK, no pullups, etc[/quote][quote userid="6462" url="~/f/nordic-q-a/49316/twi-communication-between-two-nrf52-device/196292"]Make sure you carefully instrument your Master to report problems such as no ACK, unexpected NAK, no pullups, etc[/quote]
&lt;p&gt;Also instrument it to confirm when things are successful!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/196393?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 06:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf31f503-7e71-4eb4-8846-1933c6f9fef7</guid><dc:creator>Anisa</dc:creator><description>&lt;p&gt;Thank you awneil for your quick reply.&lt;/p&gt;
&lt;p&gt;I verified that both nRF52 work as master and can detect another MCU on the I2C bus.&lt;/p&gt;
&lt;p&gt;They both could not communicate with each other as master and slave.&lt;/p&gt;
&lt;p&gt;I will connect logic analyser and check further.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI communication between two nrf52 device</title><link>https://devzone.nordicsemi.com/thread/196292?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 13:26:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:911b7413-2191-47d3-8e4b-e07c66075bd3</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I2C &lt;em&gt;&lt;strong&gt;always&lt;/strong&gt; &lt;/em&gt;needs pullups - it is an inherent part of the way the bus works!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nxp.com/docs/en/user-guide/UM10204.pdf"&gt;https://www.nxp.com/docs/en/user-guide/UM10204.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I would strongly suggest that you &lt;strong&gt;don&amp;#39;t try to do both Slave and Master at the same time!&lt;/strong&gt;&amp;nbsp;Because then you have no idea whether the problem is in your Slave, or in your Master, or in both!&lt;/p&gt;
&lt;p&gt;Since being that Master is by far the commonest use case for a Microcontroller, I suggest that you start with that; get it talking to some standard I2C peripheral.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Make sure you&amp;nbsp;thoroughly test &amp;amp; debug&amp;nbsp;your Master to&amp;nbsp;cope with common problems&amp;nbsp;such as no ACK, unexpected NAK, no pullups, etc&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Make sure you carefully instrument your Master to report problems such as no ACK, unexpected NAK, no pullups, etc.&lt;/p&gt;
&lt;p&gt;You will need an oscilloscope and/or analyser so that you can see what is happening on the I2C lines.&lt;/p&gt;
&lt;p&gt;Study the SDK examples.&lt;/p&gt;
&lt;p&gt;how to properly post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3302._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>