<?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>SPI Slave receive buffer gets garbage values</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60322/spi-slave-receive-buffer-gets-garbage-values</link><description>Hello 
 
 I am interfacing between a SPI Master (microcontroller) with a SPI Slave (nRF52832 based chip) and I get the following output on both ends. The transmission seems to be occurring but the content in the receive buffer in the spi slave program</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2020 12:50:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60322/spi-slave-receive-buffer-gets-garbage-values" /><item><title>RE: SPI Slave receive buffer gets garbage values</title><link>https://devzone.nordicsemi.com/thread/245538?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 12:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e2366cf-5d20-4178-9049-eedae0119bca</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I think the first thing you should check is that you are using the correct SPI mode.&lt;/p&gt;
&lt;p&gt;NRF_DRV_SPIS_DEFAULT_CONFIG sets the spis_config.mode =&amp;nbsp;NRF_SPIS_MODE_0. I don&amp;#39;t know what mode your SPIM uses, but the quickest way to check is to try all the modes:&lt;br /&gt;NRF_SPIS_MODE_0&lt;br /&gt;NRF_SPIS_MODE_1&lt;br /&gt;NRF_SPIS_MODE_2&lt;br /&gt;NRF_SPIS_MODE_3&lt;/p&gt;
&lt;p&gt;Just set:&lt;/p&gt;
&lt;p&gt;spis_config.mode = NRF_SPIS_MODE_1&lt;/p&gt;
&lt;p&gt;after you configure the pins to test mode 1.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t do the trick, then check that you have wired the connection correctly. Are you sure that you set MOSI -&amp;gt; MOSI and MISO -&amp;gt; MISO (and not the opposite)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another thing to check is the pull of the pins. What way does your SPIM drive the pin? Check:&lt;/p&gt;
&lt;p&gt;spis_config.csn_pullup&amp;nbsp; &amp;nbsp;= NRFX_SPIS_DEFAULT_CSN_PULLUP,&lt;/p&gt;
&lt;p&gt;My hunch is on the mode, but let me know if this doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By the way, what is the frequency that your SPIM use?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Slave receive buffer gets garbage values</title><link>https://devzone.nordicsemi.com/thread/245319?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 21:44:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:994beb70-5f86-479b-ad05-73433cf19b1e</guid><dc:creator>tp2k20</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5432.SPI-Slave.png" /&gt;&lt;/p&gt;
&lt;p&gt;In case the figure above is unclear, please see the attached figure.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>