<?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>Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84248/zephyr-spi-miso-returns-0-for-52840dk</link><description>Hello, 
 Having now finished the BLE and I2C sensor my final stop is the SPI sensor before production. I can rebuild and successfully run the ncs playground example . 
 My issue is regarding reading the MISO line however, for the sake of simplicity I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Feb 2022 12:46:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84248/zephyr-spi-miso-returns-0-for-52840dk" /><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350878?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 12:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fcc6836-eaa6-4b8a-822c-907572e579fa</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;Its late here but fortunately I saw your message to comment. You are indeed correct, it is the SPI device, I unluckily have two damaged adxl345s which is why it wasn&amp;rsquo;t working!!&lt;/p&gt;
&lt;p&gt;Thanks for confirming the code, I tested it on a different board and it worked so I guess I&amp;rsquo;ll be ordering new chips tomorrow morning.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350849?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 11:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da70252a-0ff3-4b54-9004-341de8757c99</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Agreed, sorry I didn&amp;#39;t read into the spi_test_send() function closely enough. You should indeed see something return on the MISO pin. Can you double check that your SPI device is connected to the correct pins and that it is correctly powered, and so on. I can&amp;#39;t see a reason in your code that you shouldn&amp;#39;t get any data in return, so my initial thought would be that the SPI device is not working as expected.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350698?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 13:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d18947d1-20d9-42b2-8c9c-0c7f0fcf0490</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Below is the register in question.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Device-ID.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350692?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 13:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56b2dd6-4eb3-4c0e-b733-aac765f0d7cc</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;The write_test function uses spi_test_send() which calls spi_transceive(spi_dev, &amp;amp;spi_cfg, &amp;amp;tx, &amp;amp;rx).&lt;/p&gt;
&lt;p&gt;If I write 0xC0 followed by dummy data shouldn&amp;#39;t that mean that I&amp;#39;ve accessed the register 0x00 for reading? 0x00 | 0x80 | 0x40 (0x80 for read and 0x40 for multibyte mode).&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t spi_transceive mean&amp;#39;t to send values and receive values back simultaneously from the slave device? So if I write as above I expect there to be a returned value on the MISO line (0xE5 is the value, deviceid of the adxl345).&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350679?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 12:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3db8748-4aab-4b9e-85b1-98ab30fec4e8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what you are expecting to see from the MISO when you&amp;#39;re not trying to read anything from the SPI device. Are you expecting something in return to confirm the writes or what? I think you should see activity on the MISO pin if you do a &amp;quot;read test&amp;quot; function as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr SPI MISO returns 0 for 52840dk</title><link>https://devzone.nordicsemi.com/thread/350507?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 17:03:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4a47162-0155-48de-856e-9f46b5fa0bcf</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Minor correction, dummy value is 0x00, not 0xff. No changes to the outcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>