<?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 problems with spi slave</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3442/nrf51822-problems-with-spi-slave</link><description>Hi, i&amp;#39;m trying to communicate between a msp-430f5529 (spi master) and a nrf51822 (spi slave). I have configured the MISO, MOSI, CS and SCLK of the nrf. I use the spi_slave_example for testing the communication. 
 When the spi transfer is completed it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Aug 2014 15:28:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3442/nrf51822-problems-with-spi-slave" /><item><title>RE: nRF51822 problems with spi slave</title><link>https://devzone.nordicsemi.com/thread/12465?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 15:28:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ed6739c-5ad6-4d7b-83e0-e90f20393b25</guid><dc:creator>RRGG</dc:creator><description>&lt;p&gt;Hi Stefan
Thanks for reply, the problem is that i set the CSN line once, i&amp;#39;m testing to transfer only one byte &amp;quot;0x01&amp;quot; therefore i don&amp;#39;t set high CSN (in the master) for a next time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 problems with spi slave</title><link>https://devzone.nordicsemi.com/thread/12464?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 08:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d597014-1605-47e9-a01d-163d1892d43e</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The SPIS proceidure is that when the CSN line is set high by the master, which means end of SPI transmission/reception, the SPIS handler is called with event type SPI_SLAVE_XFER_DONE, which will make your switch statement execute. You must then call spi_slave_buffers_set in order for the SPIS handler to be called again when the CSN line is set high next time.&lt;/p&gt;
&lt;p&gt;My guess is that the first time the CSN is set high and the SPIS handler is executed, the value of m_rx_buf[0] is not 0x01, so the LEDs are not turned on and you will not set the buffers, making the SPIS handler not to be called next time the CSN line is set high, i.e. your SPI communication halts.&lt;/p&gt;
&lt;p&gt;However, when you put the spi_slave_buffers_set call outside your switch statement, your handler is also called next time CSN is set high, making your SPI communication to continue. Perhaps at some point the value of m_rx_buf[0] is 0x01 and the LEDs are turned on.&lt;/p&gt;
&lt;p&gt;Try to check if my theory is correct, report back your result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 problems with spi slave</title><link>https://devzone.nordicsemi.com/thread/12463?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2014 23:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:998cef74-b8c3-444f-92e0-8c33651d92a9</guid><dc:creator>RRGG</dc:creator><description>&lt;p&gt;i forgot comment, i&amp;#39;m using softdevice at the same time. Is this the reason?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>