<?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>nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52700/nrf52832-i2c-communication-with-lis3dh-accelerometer</link><description>Hi guys. 
 I&amp;#39;m working with a nRF52832 custom board. 
 In my case my board communicates with the LIS3DH through i2c protocol. In the other hand based on LIS3DH datasheet the maximum frequency of its FIFO updating is around 5KHz. 
 I am trying to read</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Sep 2019 18:37:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52700/nrf52832-i2c-communication-with-lis3dh-accelerometer" /><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212678?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 18:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1e0716-a5d4-44ce-b7be-b1fdf55d8438</guid><dc:creator>augustopeterle</dc:creator><description>&lt;p&gt;I tried now Debug mode and Release mode, but nothing change.&lt;/p&gt;
&lt;p&gt;Thanks for reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212676?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 18:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e663fad1-138a-4b15-b959-b07ca913bae6</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;What compiler optimization level are you using? Release or debug mode? Playing with those settings may be able to help some but I have no idea by how much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212671?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 17:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c659623-96c6-49f0-bc97-0de56e9b8f6e</guid><dc:creator>augustopeterle</dc:creator><description>&lt;p&gt;I had success at reading with this function. I read two registers of OUT_X, but I still spent 13500 CPU cycles to receive those 2 registers data.&lt;/p&gt;
&lt;p&gt;With 13500 cpu cycles, the maximum frequency is 4.7KHz.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why my function is too slow. Do you have any suggest ?&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t dado[] = {0x0, 0x0};
uint32_t c_start = DWT-&amp;gt;CYCCNT;
i2c_read(0x19,LIS3DH_OUT_X_L|0x80,dado,2);
uint32_t c_stop = DWT-&amp;gt;CYCCNT;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212620?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 13:20:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c89877dc-2302-4f7b-8da3-52af33c6c259</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;When requesting multiple bits from the LIS3DH you need to make sure you are requesting the correct sub-address. See this excerpt from the datasheet:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;In order to read multiple bytes, it is necessary to assert the most significant bit of the subaddress&lt;br /&gt;field. In other words, SUB(7) must be equal to 1 while SUB(6-0) represents the&lt;br /&gt;address of first register to be read.&lt;/p&gt;
&lt;p&gt;If you want to read registers starting at OUT_X_L you need to set bit 7 to 1, ie, 0x28 |= 0x40.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212615?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 13:09:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cac915df-caae-49c9-a008-87677164ee9a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;This is using the driver found at&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/IOsonata/IOsonata/tree/master/src/sensors"&gt;https://github.com/IOsonata/IOsonata/tree/master/src/sensors&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212603?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23659b46-b5f5-4c63-b237-31f255cdd6c1</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;There are many sensors implementations using that library for your reference. &amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/tree/master/src/sensors"&gt;https://github.com/IOsonata/IOsonata/tree/master/src/sensors&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All the read/write register functions are taken care of either spi or i2c. &amp;nbsp;All you need to do is to concentrate on the sensors itself rather than spent time on the low level.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212600?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:40:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97dce5d9-4336-444f-99c0-84b31b1c636e</guid><dc:creator>augustopeterle</dc:creator><description>&lt;p&gt;I tried this. In this case the CPU uses around 13000 cycles, but I always receive zero in the 2 positions of dado array. Did I do anything wrong ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t dado[] = {0x0, 0x0};
uint32_t c_start = DWT-&amp;gt;CYCCNT;
i2c_read(0x19,LIS3DH_OUT_X_L,&amp;amp;dado,2);
uint32_t c_stop = DWT-&amp;gt;CYCCNT;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212596?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:38:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1b0822c-ac3e-4ef3-ad7a-9369ca00a76c</guid><dc:creator>augustopeterle</dc:creator><description>&lt;p&gt;Yes, I&amp;#39;m using 400KHz.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve never used this library, I&amp;#39;ll spent a little time studying this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212594?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e2aeb6c-b976-4324-b163-f3108e7a8a63</guid><dc:creator>augustopeterle</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m reading just one byte at time. I read OUT_X_L and after OUT_X_H.&lt;/p&gt;
&lt;p&gt;I tried to read 2 bytes but in this case I always receive zero em both registers.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212591?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6f97f98-135c-4c6f-9f44-7da2b375c051</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;As &lt;a href="https://devzone.nordicsemi.com/members/pcaddict"&gt;Patrick&lt;/a&gt; has pointed out it will be faster to read the two registers at the same time, i.e. sending the address of the register you want to start reading from and then reading the number of bytes you need. If you are doing this, then the only thing you can adjust is the frequency i think.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212399?ContentTypeID=1</link><pubDate>Sun, 29 Sep 2019 02:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f36f8f42-3f13-4fdc-885b-a28b1b1b32fb</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Have tried to change the frequency ? The i2c data&amp;nbsp;rate can be set up to 400kbps which is approx 40KB/s transfer rate.&lt;/p&gt;
&lt;p&gt;You may try this driver. &amp;nbsp;It&amp;#39;s more efficient tha the sdk. &amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/i2c_nrf5x.cpp"&gt;https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/i2c_nrf5x.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;usage example&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/blob/master/exemples/i2c/i2c_master_slave.cpp"&gt;https://github.com/IOsonata/IOsonata/blob/master/exemples/i2c/i2c_master_slave.cpp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 i2c communication with LIS3DH accelerometer</title><link>https://devzone.nordicsemi.com/thread/212392?ContentTypeID=1</link><pubDate>Sat, 28 Sep 2019 18:25:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cebde4a-45a1-4215-802a-575bbf704ee7</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;Are you reading the two registers independently (read x_h, read x_l) or are you requesting them in one read command (requesting two bytes during read)?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>