<?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>ADXL345 SPI setting mismatch</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9576/adxl345-spi-setting-mismatch</link><description>Hello, I am using spi_master example to get a sensor output from ADXL345. Currently, it seems my code can read output data, but there is error showing for settings mismatch and I can&amp;#39;t really find where it comes from. Current setting is Msb first, CPOL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Oct 2015 20:28:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9576/adxl345-spi-setting-mismatch" /><item><title>RE: ADXL345 SPI setting mismatch</title><link>https://devzone.nordicsemi.com/thread/35379?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2015 20:28:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2958a2c-d406-4b2b-89a1-3bd1f0301119</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;Hey I messed with the ADXL345 a little bit and started a library. All I got to was reading the deviceID (register 0x00) and verifying that what I was reading was correct. Here is the library I put together based off the SDK example in the most recent nRF52 SDK. It might help you. Very simple and based off what Nordic provides in their most recent SDK example - just stripped down to the basics.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/mjdietzx/Warthog/tree/spim/nRF52_SDK/warthog_library"&gt;github.com/.../warthog_library&lt;/a&gt;
&lt;a href="https://github.com/mjdietzx/Warthog/blob/spim/nRF52_SDK/warthog_library/warthog_spi.c"&gt;github.com/.../warthog_spi.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;note: I used easydma.&lt;/p&gt;
&lt;p&gt;and in main.c, something like:&lt;/p&gt;
&lt;p&gt;#include &amp;quot;warthog_spi.h&amp;quot;&lt;/p&gt;
&lt;p&gt;uint8_t tx_data_spi[TX_RX_MSG_LENGTH];&lt;/p&gt;
&lt;p&gt;uint8_t rx_data_spi[TX_RX_MSG_LENGTH];&lt;/p&gt;
&lt;p&gt;int main()
{&lt;/p&gt;
&lt;p&gt;const nrf_drv_spi_t spi_master_0 = NRF_DRV_SPI_INSTANCE(0);&lt;/p&gt;
&lt;p&gt;spi_master_init(&amp;amp;spi_master_0);&lt;/p&gt;
&lt;p&gt;tx_data_spi[0] = (0UL);&lt;/p&gt;
&lt;p&gt;spi_send_recv(&amp;amp;spi_master_0, tx_data_spi, rx_data_spi, TX_RX_MSG_LENGTH);&lt;/p&gt;
&lt;p&gt;for (;;)
}&lt;/p&gt;
&lt;p&gt;note that easydma means that the data read in spi will be stored in a buffer in RAM directly, without CPU intervention.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>