<?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>Using SPI Master on nRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9252/using-spi-master-on-nrf52</link><description>I am trying to communicate with a SPI peripheral acting slave to the nRF52 master. I am using v0.9.1 of the SDK, the example is called spi_master, with the uVision project named spi_master_pca10036.uvprojx 
 One thing I now know, is that the settings</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Sep 2015 10:26:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9252/using-spi-master-on-nrf52" /><item><title>RE: Using SPI Master on nRF52</title><link>https://devzone.nordicsemi.com/thread/34141?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2015 10:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c86a49c-ef18-4c4e-a74e-189cbe3bdcf5</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I&amp;#39;m glad it works. I answered your post in the other thread. Feel free to accept and close this thread if you don&amp;#39;t have more questions related to this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SPI Master on nRF52</title><link>https://devzone.nordicsemi.com/thread/34140?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2015 19:46:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:664e1531-d979-4257-8605-2797f5ca95d3</guid><dc:creator>Papyrus</dc:creator><description>&lt;p&gt;Hi Marin,&lt;/p&gt;
&lt;p&gt;Thanks for your clarification here.  I have tried the loopback example with my pin configuration, and that works.  Thus, I have taken your advise and not used this example as a starting pont for communication with a slave, rather I am using spi_master_with_spi_slave.  Unfortunately there are similar problems in that the processor consistently and persistently faults out.  To keep things clean, I have posted a new question so this one does not become unruly and overcomplicated :)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/51527/nrf52-spi_master_with_spi_slave-example-always-faults-out/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hopefully the post above is a better starting point to troubleshoot my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SPI Master on nRF52</title><link>https://devzone.nordicsemi.com/thread/34139?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2015 11:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eab7b571-b928-401c-95fa-325cf4808e3c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;I agree with you that the &amp;quot;double definitions&amp;quot; are confusing. I have reported it to our SDK team.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As I&amp;#39;m sure you know MISO is Master Input/Slave Output meaning it is the slave that is driving the line. Hence, my suspicion is that your slave is not working or configured properly. The MISO pin on the nRF52 should be properly configured by the drivers. The waveform you see might be some sort of interference from the MOSI or CLK line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I suspect that this is because there is a function call to &lt;code&gt;check_buf_equal()&lt;/code&gt; inside the &lt;code&gt;spi_master_x_event_handler()&lt;/code&gt;. This function is comparing the TX and RX buffers and if they are not the same the function will return an error condition. So, if you have not removed these two lines:&lt;/p&gt;
&lt;p&gt;result = check_buf_equal(m_tx_data_spi, m_rx_data_spi, TX_RX_MSG_LENGTH);
APP_ERROR_CHECK_BOOL(result);&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;and if you are not doing a loopback or a have slave device that returns exactly what it receives your application will stall in the &lt;code&gt;app_error_handler()&lt;/code&gt; function. If you have already taken care of this it might be because you are trying to transmit too fast and the SPI module is busy. This is a quote from the &lt;code&gt;nrf_drv_spi_transfer()&lt;/code&gt; documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If an event handler was provided in
nrf_drv_spi_init() call, this function
returns immediately and the handler is
called when the transfer is done.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In other words, if you are using an error handler like &lt;code&gt;spi_master_x_event_handler()&lt;/code&gt; and you don&amp;#39;t make sure that the SPI is not busy before you start another transmission then &lt;code&gt;nrf_drv_spi_transfer()&lt;/code&gt; will return &lt;code&gt;NRF_ERROR_BUSY&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Here is a relevant thread: &lt;a href="https://devzone.nordicsemi.com/question/50155/spi-master-example-on-nrf52-dk-consistently-fails/"&gt;SPI Master Example on nRF52 DK consistently fails&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>