<?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>Adding TWI communication with accelerometer to BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12009/adding-twi-communication-with-accelerometer-to-ble</link><description>Hello, 
 I have a nRF51DK.
I am trying to use the TWI driver to communicate via I2C with an accelerometer MMA8452Q.
I already have a working code based on several SDK examples : basically it is based on the &amp;quot;experimental : multiactivity&amp;quot; example with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Mar 2016 23:25:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12009/adding-twi-communication-with-accelerometer-to-ble" /><item><title>RE: Adding TWI communication with accelerometer to BLE</title><link>https://devzone.nordicsemi.com/thread/45462?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2016 23:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ab3d81e-66ff-4160-93c3-e660433dcdbf</guid><dc:creator>bneil</dc:creator><description>&lt;p&gt;I was just playing around with this stuff as well. If you look at the datasheet for the accelerometer they&amp;#39;re using in the example, the address is actually 0x4c. When shift that up you get 0x98. What I believe is happening (I&amp;#39;m still learning this stuff myself) is that they are writing the address like that because there needs to be room for the read/write bit to be set, but to be honest, that&amp;#39;s a guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding TWI communication with accelerometer to BLE</title><link>https://devzone.nordicsemi.com/thread/45461?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 19:45:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b9998b8-9c7f-4c5e-97e0-d18a5896511d</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Do you have some 4.7 Kohms external pullup resistors ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding TWI communication with accelerometer to BLE</title><link>https://devzone.nordicsemi.com/thread/45460?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2016 11:30:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4f08bd0-b0bf-4f61-b67f-cb2f104470fc</guid><dc:creator>MR2</dc:creator><description>&lt;p&gt;I think I corrected my problem but I am unsure whether the correction is right or not:
In the twi_sensor example, the address of the sensor is defined like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define MMA7660_ADDR        (0x98U &amp;gt;&amp;gt; 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the &amp;quot;&amp;gt;&amp;gt; 1&amp;quot; probably refers to the following description of the twi functions:
[in]	address	Address of a specific slave device (only 7 LSB).
However, when I use the same syntax for the MMA8452Q device, i.e.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define MMA8452Q_ADDR      (0x1DU &amp;gt;&amp;gt; 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the device never answers to any read or write requests.
When I remove the &amp;quot;&amp;gt;&amp;gt; 1&amp;quot; everything works perfectly.
Is this correct to remove the &amp;quot;&amp;gt;&amp;gt; 1&amp;quot; in my case? And why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>