<?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>Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40541/failed-to-read-write-adxl362-data-using-nrf52840</link><description>Hello All, 
 
 I have connected nRF52840 with ADXL362 over SPI, and try to read/write data on &amp;quot;Power Control register&amp;quot;. 
 The process I follow, 
 1. Rest ADXL362. 
 2. Write data 0x02 in &amp;quot;Power Control register&amp;quot; of ADXL362. 
 2. Read value of &amp;quot;Power Control</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 May 2023 06:20:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40541/failed-to-read-write-adxl362-data-using-nrf52840" /><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/426037?ContentTypeID=1</link><pubDate>Wed, 17 May 2023 06:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56999995-4178-42b1-81e7-5287e1c28a44</guid><dc:creator>Marko W</dc:creator><description>&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;I recently had the same problem with the ADXL362 on an nRF52832DK board.&lt;/span&gt;&lt;/span&gt; &lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;I connected the ADXL362 (on a developer board &amp;quot;ADXL362/346&amp;quot;) with a short cable (about 5 cm).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;After many attempts in all possible directions (clock, source code, waveform, resistances in signal lines), I found a solution:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;I removed the cables and soldered a pin strip directly to the &amp;quot;ADXL362/346&amp;quot; developer board (without VIN, this is connected to VDD on P1 by cable) and plugged it directly into P4 (pin 0.19 to GND).&lt;/span&gt;&lt;/span&gt;&lt;span class="jCAhz"&gt;&lt;span class="ryNqvb"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;Since this is plugged in directly, the ADXL362 works without any problems.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t find that plausible, but I was able to continue my project with it.&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;I&amp;#39;m not sure if it will help others, but it&amp;#39;s worth a try.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;And it would be nice to hear if this has helped others as well.&lt;/span&gt;&lt;/span&gt;&lt;span class="jCAhz"&gt;&lt;span class="ryNqvb"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;Best regards&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;Marko&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/261721?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:05:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2fb9e2b-213f-4115-aaec-68dc7d5b94fc</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you create a new case, with logic traces, and explain your specific setup (which GPIOs you&amp;#39;re using etc), we can help you out. This case is over 2 years old, and is likely outdated for your use-case (SDK used etc).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/261429?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2020 15:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8141a89d-26e9-4034-a574-ba8660782a8d</guid><dc:creator>rkorn</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m experiencing the same issue with the ADXL362 and the NRF52840DK.&amp;nbsp; Were you able to resolve the issue?&amp;nbsp; I suspect this is an issue with the ADXL362, not the Nordic.&amp;nbsp; I&amp;#39;m going to try breaking up the writes next.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/159525?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 10:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9317ebac-3494-430b-9bce-842f21b51a81</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I cannot see any difference in the way the communication is performed, other than the nRF sends the 3 bytes without any delay.&lt;/p&gt;
&lt;p&gt;You could try to split up the transfer into 1 byte transfers, like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        for (int i = 0; i &amp;lt; 3; i++){
            APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;m_tx_buf[i], 1, &amp;amp;m_rx_buf[i], 1));
            spi_xfer_done = false;
            while (!spi_xfer_done)
            {
                __WFE();
            }
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However; the sensors datasheet states that this should work without delay in SPI communication.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you please provide a scope/logic analyzer trace of all SPI lines at the same time, with both arduino and the nRF solution? It is close to impossible to see whats happening without having all SPI lines in the same trace.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/159465?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 05:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e59ae30-3f61-4c55-9529-e3c13f9767df</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;Hello Sir,&lt;/p&gt;
&lt;p&gt;Thanks for replay.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Could you post your latest source code that performs the SPI read/write?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Ans: Please find spim_adxl362.zip file contains source code for reading 0x01 register.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Could you post the arduino code used?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For Arduino I follow &lt;a href="https://ez.analog.com/mems/w/documents/4505/adxl362-arduino-how-to"&gt;this document&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1. Open ADXL362_SimpleRead example sketch.&lt;/p&gt;
&lt;p&gt;2. To read 0x01 register modify ADXL362 library. added readDevIDData() function in it. ADXL362.cpp file is attached here.&lt;/p&gt;
&lt;p&gt;3. called readDevIDData() in loop.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note: SDK version: nRF5_SDK_15.0.0_a53641a&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4237.ADXL362.cpp"&gt;devzone.nordicsemi.com/.../4237.ADXL362.cpp&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6747.ADXL362.h"&gt;devzone.nordicsemi.com/.../6747.ADXL362.h&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3247.spim_5F00_adxl362.zip"&gt;devzone.nordicsemi.com/.../3247.spim_5F00_adxl362.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/159429?ContentTypeID=1</link><pubDate>Wed, 28 Nov 2018 14:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d762bc54-b632-416e-a2ac-7bbafb70c676</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;1. Could you post your latest source code that performs the SPI read/write?&lt;/p&gt;
&lt;p&gt;2. Could you try only reading the 0x01 register. Do not run the Soft-reset or powerctl routine.&lt;/p&gt;
&lt;p&gt;3. Could you post the arduino code used?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158945?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 04:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0d34955-481c-4f99-bec7-12ad9e243275</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;Hello Sir,&lt;/p&gt;
&lt;p&gt;As per ADXL362, here is command structure for read register&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;strong&gt; &amp;lt;/CS down&amp;gt; &amp;lt;command byte (0x0A or 0x0B)&amp;gt; &amp;lt;address byte&amp;gt; &amp;lt;data byte&amp;gt; &amp;lt;additional data bytes for multi-byte&amp;gt; &amp;hellip; &amp;lt;/CS up&amp;gt;&lt;/strong&gt;&amp;quot; &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I am sending same command for Arduino &amp;amp; nRF52840. The command is &lt;br /&gt;&lt;strong&gt;0x0B 0x01 0x00&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can check this in above attached waveform. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158808?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 11:35:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8404906-7190-43eb-86a6-44188c8da382</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Judging by the scoping of CLK+MISO, the resonse is incorrect. This may indicate that there&amp;#39;s a difference between the inputted data on MOSI.&lt;/p&gt;
&lt;p&gt;Is there any difference in the MOSI data compared to the arduino?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158790?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 09:50:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83af652d-730b-451c-9031-b77b1bb3902a</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;Hello Sir,&lt;/p&gt;
&lt;p&gt;Any update on this.&lt;/p&gt;
&lt;p&gt;Waiting for replay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158538?ContentTypeID=1</link><pubDate>Thu, 22 Nov 2018 07:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b808411-7aa3-407a-b9a0-b71b359685d5</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;&amp;nbsp;Hello Sir,&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;I connect ADXL362 to Arduino &amp;amp; check waveform on oscilloscope.&lt;br /&gt;&amp;nbsp;I am reading register 0x01 (having device MEMS ID)&lt;br /&gt;&amp;nbsp;So data I am sending on MOSI is 0x0B (Read register command) , 0x01 (register address), 0x00 (dummy data).&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;Here is the waveform for CLK &amp;amp; MOSI&lt;/p&gt;
&lt;p&gt;&lt;img alt="CLK &amp;amp; MOSI" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7711.scope_5F00_1.png" /&gt;&lt;/p&gt;
&lt;p&gt;waveform for CLK &amp;amp; MISO&lt;/p&gt;
&lt;p&gt;&lt;img alt="CLK &amp;amp; MISO" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0647.MISO.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Arduino adds 1us delay in CLK after sending 1 byte. but nRF52840 sending continouns CLK signal (please refer previous post)&lt;br /&gt;&lt;br /&gt;What is the reason to add delay on CLK?&lt;br /&gt;If I want to add delay in CLK, Where do I add this in SPI driver?&lt;br /&gt;&lt;br /&gt;Note: SDK version is 15.0.0_a53641a&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158187?ContentTypeID=1</link><pubDate>Tue, 20 Nov 2018 13:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fdf87f1-3eeb-4423-b0e9-6f39ed4b7eac</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So use your scope to compare what happens in the Arduino (working) case against what happens with your nRF...&lt;/p&gt;
&lt;p&gt;Note that the Keysight scopes can capture screen images to a USB stick&amp;nbsp;- much better than taking photos!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/158182?ContentTypeID=1</link><pubDate>Tue, 20 Nov 2018 13:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a172a4b-c034-4c93-b827-e7d265b6a664</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;Hello Sir,&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;As per your guide line I set SPI frequency to 1MHz and try to read register 0x01 (having device MEMS ID).&lt;br /&gt;&amp;nbsp;I am getting wrong value &lt;span style="text-decoration:underline;"&gt;0x18&lt;/span&gt; instead on &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;0x1D&lt;/strong&gt;&lt;/span&gt; (default value).&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;Here attached waveform of CLK &amp;amp; MOSI pin.&lt;/p&gt;
&lt;p&gt;&lt;img alt="CLK &amp;amp; MOSI pin" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20181120_5F00_170440564.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Waveform for CLK &amp;amp; MISO pin&lt;/p&gt;
&lt;p&gt;&lt;img alt="CLK &amp;amp; MISO" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20181120_5F00_173202720.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;Data we are sending on MOSI is &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;0x0B&lt;/strong&gt;&lt;/span&gt; (Read register command) , &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;0x01&lt;/strong&gt;&lt;/span&gt; (register address), &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;0x00&lt;/strong&gt; &lt;/span&gt;(dummy data).&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;Next I connect my ADXL362 evaluation board to Arduino and follow &lt;a href="https://ez.analog.com/mems/w/documents/4505/adxl362-arduino-how-to"&gt;this document&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;Logs from Arduino device showing correct data for register value 0x00, 0x01, 0x02&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;So my ADXL362 evaluation board is not damages.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;But when I connect ADXL362 to nRF52840 DK I am getting wrong data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/157996?ContentTypeID=1</link><pubDate>Mon, 19 Nov 2018 14:17:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e29246ba-bbbb-4523-8fbe-64b97eed518d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you scoped the signal to see how it looks? You might be running on too high SPI frequency.&lt;/p&gt;
&lt;p&gt;You can change the frequency in spi_config.frequency =&amp;nbsp;NRF_DRV_SPI_FREQ_1M.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/157988?ContentTypeID=1</link><pubDate>Mon, 19 Nov 2018 13:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06f16094-f2c3-4740-b21d-5fb3ec3df71f</guid><dc:creator>beparas</dc:creator><description>&lt;p&gt;Hello Sir,&lt;/p&gt;
&lt;p&gt;Thanks for you replay.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I recheck the pin connection (MOSI &amp;lt;--&amp;gt; MOSI, MISO &amp;lt;--&amp;gt; MISO), are ok.&lt;/p&gt;
&lt;p&gt;I simplify above program &amp;amp; try to read Analog device ID (register address 0x00), MEMS ID (0x01), Part ID (0x02) but I am getting wrong values.&lt;/p&gt;
&lt;p&gt;As per &lt;a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL362.pdf"&gt;ADXL362 datasheet&lt;/a&gt; default values for register address &lt;strong&gt;0x00&lt;/strong&gt; is &lt;strong&gt;0xAD&lt;/strong&gt;,&amp;nbsp; for register &lt;strong&gt;0x01&lt;/strong&gt; is &lt;strong&gt;0x1D,&lt;/strong&gt; for register 0x02 is&amp;nbsp;&lt;strong&gt;0xF2.&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But I am getting wrong values for these register. &lt;/p&gt;
&lt;p&gt;The values I am getting for register address &lt;strong&gt;0x00&lt;/strong&gt; is &lt;strong&gt;0x90&lt;/strong&gt;,&amp;nbsp; for register &lt;strong&gt;0x01&lt;/strong&gt; is &lt;strong&gt;0x18,&lt;/strong&gt; for register 0x02 is&amp;nbsp;&lt;strong&gt;0xF0.&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Could you please explain the reason for wrong values?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void spi_event_handler(nrf_drv_spi_evt_t const * p_event,
                       void *                    p_context)
{
    spi_xfer_done = true;
    NRF_LOG_INFO(&amp;quot;Transfer completed.&amp;quot;);
    if (m_rx_buf[0] != 0)
    {
        NRF_LOG_INFO(&amp;quot; Received:&amp;quot;);
        NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));
    }
    else
      NRF_LOG_HEXDUMP_INFO(m_rx_buf, 3);
}
		
int main(void)
{
    bsp_board_init(BSP_INIT_LEDS);

    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.ss_pin   = SPI_SS_PIN;
    spi_config.miso_pin = SPI_MISO_PIN;
    spi_config.mosi_pin = SPI_MOSI_PIN;
    spi_config.sck_pin  = SPI_SCK_PIN;
      
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));

    NRF_LOG_INFO(&amp;quot;#########################################################&amp;quot;);
    NRF_LOG_INFO(&amp;quot;SPI example started.&amp;quot;);

    while (1)
    {
        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, m_length);
        spi_xfer_done = false;

        // &amp;lt;/CS down&amp;gt; &amp;lt;command byte (0x0A or 0x0B)&amp;gt; &amp;lt;address byte&amp;gt; &amp;lt;data byte&amp;gt; &amp;lt;additional data bytes for multi-byte&amp;gt; … &amp;lt;/CS up&amp;gt;
        m_tx_buf[0] = 0x0B;       // Read Register
        m_tx_buf[1] = 0x00;
        m_tx_buf[2] = 0x00;       // dummy data

        APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, 3, m_rx_buf, 3));

        while (!spi_xfer_done)
        {
            __WFE();
        }

        NRF_LOG_FLUSH();

        bsp_board_led_invert(BSP_BOARD_LED_0);
        nrf_delay_ms(200);
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to read/write ADXL362 data using nRF52840</title><link>https://devzone.nordicsemi.com/thread/157725?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2018 13:19:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2232a67-272c-4c2f-97eb-829ea1f4b588</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Code is also attached here, will you please guide me, If I did any wrong in SPI configuration?[/quote]
&lt;p&gt;You configuration looks to be correct, MSB first, SPI Mode 0.&lt;/p&gt;
&lt;p&gt;Are you sure that you have connected the pins correctly to the SPIS device? MISO to MISO, MOSI-&amp;gt;MOSI, etc.?&lt;/p&gt;
&lt;p&gt;Try reading a register, for instance PARTID (0x02), as this is non-zero in reset-value.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;I am little bit confuse of &amp;quot;&lt;em&gt;tx_buffer_length&lt;/em&gt;&amp;quot; &amp;amp; &amp;quot;&lt;em&gt;rx_buffer_length&lt;/em&gt;&amp;quot; value passing in&amp;nbsp;&lt;em&gt;nrf_drv_spi_transfer()&amp;nbsp;&lt;/em&gt;function.&lt;/p&gt;
&lt;p&gt;Does the values of &amp;quot;&lt;em&gt;tx_buffer_length&lt;/em&gt;&amp;quot; &amp;amp; &amp;quot;&lt;em&gt;rx_buffer_length&lt;/em&gt;&amp;quot; are correct at line no 101 &amp;amp; 118 in main.c file?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is related to the amount of bytes to send (tx) and the expected number of bytes you read (Rx) from the sensor. This may differ from register-to-register on your SPI slave device.&lt;/p&gt;
&lt;p&gt;This function looks a bit suspicious:&lt;/p&gt;
&lt;p&gt;uint8_t adxl362_read_one_reg(uint8_t reg_address)&lt;br /&gt;{&lt;br /&gt; uint8_t tx_buff[3] = {0};&lt;br /&gt; uint8_t rx_buff[3] = {0};&lt;/p&gt;
&lt;p&gt;// &amp;lt;/CS down&amp;gt; &amp;lt;command byte (0x0A or 0x0B)&amp;gt; &amp;lt;address byte&amp;gt; &amp;lt;data byte&amp;gt; &amp;lt;additional data bytes for multi-byte&amp;gt; … &amp;lt;/CS up&amp;gt;&lt;br /&gt; tx_buff[0] = XL362_REG_READ;&lt;br /&gt; tx_buff[1] = reg_address;&lt;br /&gt; tx_buff[2] = 0x00; // dummy byte&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, tx_buff, 3, rx_buff, 1));&lt;br /&gt; NRF_LOG_INFO(&amp;quot;** %d %d %d&amp;quot;, rx[0], rx[1], rx[2]);&lt;br /&gt; NRF_LOG_HEXDUMP_INFO(rx, 2);&lt;/p&gt;
&lt;p&gt;return rx_buff[2];&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here you are sending 3 bytes, then receiving one (rx_buff[0]), then returning index 2 in rx_buff. Given your print log, it is still 0x0, but this function is likely not working as you intend it to.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>