<?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>nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8384/nrf51822-with-lis3dh-using-spi</link><description>I tried in vain to connect my nRF51822 eval board with LIS3DH using SPI. Currently I am using the SPI example in PCA10001 with spi_master_init and spi_master_tx_rx function. After some initialisation code, I would like to read the xyz value from LIS3DH</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 09 Aug 2020 18:36:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8384/nrf51822-with-lis3dh-using-spi" /><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/263732?ContentTypeID=1</link><pubDate>Sun, 09 Aug 2020 18:36:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2308c4b6-a086-484e-a635-aeec09b734ea</guid><dc:creator>walterLIte</dc:creator><description>&lt;p&gt;no&amp;nbsp; ..still no results&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/226801?ContentTypeID=1</link><pubDate>Tue, 24 Dec 2019 11:08:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a87368df-a257-446b-a6e9-ad0181a64687</guid><dc:creator>Christoph_I</dc:creator><description>&lt;p&gt;Hey walterLlte, Jules, Davies Chung and Mango. Do you have the results of Davis Chung? It would be really nice to have the results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30427?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 20:18:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c3710d5-e162-4fe0-9ae3-e158f5557c72</guid><dc:creator>walterLIte</dc:creator><description>&lt;p&gt;anyone get this to work ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30426?ContentTypeID=1</link><pubDate>Sun, 15 May 2016 09:59:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae447ccd-6e18-4f36-9ac1-8cbbcbd174ee</guid><dc:creator>Jules</dc:creator><description>&lt;p&gt;Hi ! Could you share your results ? I am trying to use the LIS3DH in vain too, I see that some people managed to do it on this forum, but nobody posted how they did :/ I hope I&amp;#39;m not too late !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30425?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 16:27:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24993ac4-cd33-42c3-ac69-fc5fea13e082</guid><dc:creator>Davis Chung</dc:creator><description>&lt;p&gt;Thanks Mango in responding to my question so prompt. I really appreciate it!
After your reminder about the CS pin and also reading of the WHO_AM_I register, I tried a few settings and finally everything goes smooth. Now I could config the LIS3DH to generate nice interrupt signal when it detects any motion. Thanks you very much!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30424?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 04:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d053f7b-d723-4faf-853d-0ab868d5363b</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;I&amp;#39;m not 100% sure whether it is okay to hold the CS pin to GND.&lt;/p&gt;
&lt;p&gt;The best way to check is using the oscilloscope, in my opinion.&lt;/p&gt;
&lt;p&gt;Because you can tell whether your code is wrong or your hardware has problems.&lt;/p&gt;
&lt;p&gt;Hook up the MISO and MOSI if they show the result you expected.&lt;/p&gt;
&lt;p&gt;If it does not, it won&amp;#39;t be good to hold the CS pin to GND.&lt;/p&gt;
&lt;p&gt;As you see at the datasheet, Figure 10 shows that you need to tie the CS to GND to write multiple bytes.&lt;/p&gt;
&lt;p&gt;However, your code may not create the clock signal continuously like Figure 10.&lt;/p&gt;
&lt;p&gt;Also, if you see Figure 3, CS&amp;#39;s hold time and Output disable time are stated.&lt;/p&gt;
&lt;p&gt;You have to make the signals like Figure 3 and I think holding the CS to GND will screw this.&lt;/p&gt;
&lt;p&gt;In this sense, I do not recommend you to tie the CS pin.&lt;/p&gt;
&lt;p&gt;I hope for you to work out well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30423?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 01:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfe7d7ce-4080-471c-bbf9-f1c2057b63c4</guid><dc:creator>Davis Chung</dc:creator><description>&lt;p&gt;Thanks for answering. I have physically connected the CS pin to GND, so Im wondering it should be fine, shouldn&amp;#39;t?? And I should definitely try to read the 0Fh register.
Indeed Im not sure whether my code is correct or not. I hope it would be a soldering problem. I will check about it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 with LIS3DH using SPI</title><link>https://devzone.nordicsemi.com/thread/30422?ContentTypeID=1</link><pubDate>Sun, 26 Jul 2015 18:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dd5d4d7-5251-4d13-9f86-5b86f5982533</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Hi, I once tried those ST&amp;#39;s accelerometer with other vendor&amp;#39;s MCU.&lt;/p&gt;
&lt;p&gt;However I didn&amp;#39;t tried the SPI example so I can&amp;#39;t tell much about the code.&lt;/p&gt;
&lt;p&gt;The pin connection&lt;/p&gt;
&lt;p&gt;(MISO nRF51822 SPI RX - pin 7 SDO  and MOSI nRF51822 SPI TX - pin 6 SDA) is correct.&lt;/p&gt;
&lt;p&gt;As far as I know, if you use the NRF51822 as a master, you might need to control the CS pin to low manually.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;(Since I haven&amp;#39;t tried SPI, I state my answer with caution.)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But you did not make a connection with the CS pin, did you?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2063.SPI.png" alt="Block" /&gt;&lt;/p&gt;

&lt;p&gt;Assuming the code is correct, I really hope it is just a soldering problem.&lt;/p&gt;
&lt;p&gt;Also I will just assume that you have soldered the accelerometer to a board like this.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ger.png" alt="Change" /&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what this is called in English.&lt;/p&gt;
&lt;p&gt;So, can you check two things?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you have an oscilloscope, can you check your CS pin drops to 0 Volts when you read?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If it does not become low, the accelerometer is using I2C.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/spi-read.png" alt="Read" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/spi-i2c.png" alt="i2c" /&gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;What is the result when you read the &lt;code&gt;WHO_AM_I (0Fh)&lt;/code&gt; register?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The result should be 0x33.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/spiwho.png" alt="Who Am I" /&gt;&lt;/p&gt;
&lt;p&gt;If you do not receive this, the soldering may not be done perfectly to that red board up there.&lt;/p&gt;
&lt;p&gt;Finally, try your code once more after adding codes about lowering the CS.&lt;/p&gt;
&lt;p&gt;Or ask the Nordic developers whether the SDK can control the CS pin you are about to use.&lt;/p&gt;
&lt;p&gt;I hope you could search some examples that lowers the CS pins.&lt;/p&gt;
&lt;p&gt;Also, check once more about the&lt;code&gt;SPI_MODE0 ,1 ,2 ,or 3&lt;/code&gt; you should use.&lt;/p&gt;
&lt;p&gt;-Regards, Mango922&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>