<?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>NRF51822qfaa,s110 v8.0,TWI question,please help me.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13863/nrf51822qfaa-s110-v8-0-twi-question-please-help-me</link><description>I use NRF51822qfaa,s110 v8.0, now I use master TWI to drive the TWI bus chip.
the TWI bus chip Slave Address is 0x48.please see the below program . 
 question: 
 1.The slave_add is 0X24,is OK?if is not ,please tell me the right value. 
 2.The nrf_drv_twi_rx</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 May 2016 14:52:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13863/nrf51822qfaa-s110-v8-0-twi-question-please-help-me" /><item><title>RE: NRF51822qfaa,s110 v8.0,TWI question,please help me.</title><link>https://devzone.nordicsemi.com/thread/52959?ContentTypeID=1</link><pubDate>Mon, 23 May 2016 14:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc970d24-3474-4f11-a23f-60022cc01131</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The slave_add is 0X24,is OK:&lt;/strong&gt; This depends. My guess is that it should stay at 0x48. Please have a look at my answer in &lt;a href="https://devzone.nordicsemi.com/question/71861/twi-starting/"&gt;this thread&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you look at the declaration of nrf_drv_twi_rx() in nrf_drv_twi.h and the error codes defined in nrf_error.h you will see that error code 3 signify &lt;code&gt;// NRF_ERROR_INTERNAL If an error was detected by hardware.&lt;/code&gt;. This error might be caused by many things. It might for example very well be that you are using the wrong address so your slave doesn&amp;#39;t acknowledge your transmissions.&lt;/li&gt;
&lt;li&gt;You can try &lt;a href="https://github.com/Martinsbl/twi-find-devices-on-bus"&gt;this example&lt;/a&gt;. It is a very basic example that will show you how to use the drivers with an event handler and what address to use.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Regarding your code snippet: It looks like you are trying to do a TWI read operation immediately after you have enabled the TWI. I don&amp;#39;t know what kind of TWI slave you are using, but it is common that you first have to do a TWI &lt;em&gt;write&lt;/em&gt; operation to tell your slave what address to read from. &lt;a href="https://github.com/Martinsbl/nrf5-mpu-examples"&gt;Here&lt;/a&gt; are some more advanced TWI examples showing how to interface an accelerometer. In the driver file, &lt;a href="https://github.com/Martinsbl/nrf5-mpu-examples/blob/master/mpu.c"&gt;mpu.c&lt;/a&gt;, you can see how one can read registers in the function called &lt;code&gt;mpu_read_registers()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>