<?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>Problem in twi/i2c communication receiving data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9871/problem-in-twi-i2c-communication-receiving-data</link><description>Hi 
I&amp;#39;m trying to communicate between nrf51-DK and arduino using twi. I was able to send data from nrf51-DK to arduino using nrf_drv_twi_tx but when I&amp;#39;m trying to send the data from arduino to DK, I&amp;#39;m unable to receive the data. Debugging on arduino</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Aug 2017 09:52:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9871/problem-in-twi-i2c-communication-receiving-data" /><item><title>RE: Problem in twi/i2c communication receiving data</title><link>https://devzone.nordicsemi.com/thread/36618?ContentTypeID=1</link><pubDate>Thu, 10 Aug 2017 09:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c723785-d16e-49cf-8d19-be19d533c566</guid><dc:creator>anv</dc:creator><description>&lt;p&gt;I guess the reason why you can not see RXD in TWI-&amp;gt;TWI0 is that to show it to you in debug window Keil schould really read it from the chip, but for this there is no matter who is reading it&amp;#39;s registers, it will behave as if YOUR CODE has read the register and react correspondingly. You can still see the registers in View-&amp;gt;Memory Window-&amp;gt;Window# (you know the address), but don&amp;#39;t be surprized by this &amp;quot;strange&amp;quot; behaviour.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in twi/i2c communication receiving data</title><link>https://devzone.nordicsemi.com/thread/36617?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 15:04:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:993d8b48-e436-405f-8f2d-43cbd16d2759</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;Got the code working, what a silly mistake i was doing, Thanks :). For the RXD register, I tried changing optimization to all the options and recompiled the project, but RXD is still not showing in the debug window. Also can you tell me about the process to view err_code, it says &amp;quot;out of scope&amp;quot; in debug window?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in twi/i2c communication receiving data</title><link>https://devzone.nordicsemi.com/thread/36616?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 14:52:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eea7f6a-0aca-4a7c-8849-cb838190c705</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The array is not allocated, change to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t rx_data[1];

err_code = nrf_drv_twi_rx(&amp;amp;p_twi, 0x08, rx_data, sizeof(rx_data), false);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To get all bytes you should make the array of size 4.&lt;/p&gt;
&lt;p&gt;Usually you can see all registers in View-&amp;gt;System viewer-&amp;gt;TWI-&amp;gt;TWI0, but I see that the RXD register is not there. I do not know quite why. To see the variables, try to turn down the optimization in project-&amp;gt;options for target-&amp;gt;c/c++ tab.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>