<?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>About nrf51822 as SPI-Slave</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37985/about-nrf51822-as-spi-slave</link><description>Hi Nordic, 
 I am using SDK 12.3.0, S130 2.0.1 and PCA10028 nrf51 DK. 
 I would like to use nrf51822 as SPI slave and other MCU as SPI master. I am using spis_pca10028 example as a starting point. 
 
 And here are some questions about SPIS, 
 1. Can I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Aug 2018 09:14:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37985/about-nrf51822-as-spi-slave" /><item><title>RE: About nrf51822 as SPI-Slave</title><link>https://devzone.nordicsemi.com/thread/146456?ContentTypeID=1</link><pubDate>Thu, 30 Aug 2018 09:14:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64461b2d-6fb1-4ab6-9e79-3bc20173440c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, this is the statement from the reference manual: &amp;quot;The SPI slave will try to acquire the semaphore when CSN goes low&amp;quot;. I have not tested with leaving the CSN low during SPIS init, but I doubt that this will work. Feel free to try it and report back your findings though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About nrf51822 as SPI-Slave</title><link>https://devzone.nordicsemi.com/thread/146450?ContentTypeID=1</link><pubDate>Thu, 30 Aug 2018 08:59:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff6afce8-8d9e-4b0d-9e83-7c155ee7c86c</guid><dc:creator>John_Doe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;About the first question, Do you mean that SPIS module needs falling edge of CS pin to &lt;span&gt;acquire&lt;/span&gt;&lt;span&gt;&amp;nbsp;the semaphore? And in my case, after nrf51822 initialing spis module and signal master to send data (CS pin is low during that time), master need to,&amp;nbsp;&lt;/span&gt;&lt;span&gt;Pull high CS pin -&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Pull low CS pin -&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;SPI data transmition?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About nrf51822 as SPI-Slave</title><link>https://devzone.nordicsemi.com/thread/146445?ContentTypeID=1</link><pubDate>Thu, 30 Aug 2018 08:48:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24d3a9d9-5085-4f2b-8f32-8d309f7734b2</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;No, this will not work. You will need to pull the CSN pin low after SPIS is initialized in order to aquire the semaphore. I would recommend that you first set the pin low using a GPIO, and then pull it low again after the SPIS driver have been initialized. You can have a look at the pin_change_interrupt example to&amp;nbsp;get an idea of how to add code to init SPIS on pin changes. Make sure you disable the pin interrupt before initializing SPIS on the same pin.&lt;/li&gt;
&lt;li&gt;You cannot safely update the data pointers during a transfer, as the CPU needs to aquire the semaphore first. The semaphore is aquired by the SPIS peripheral while a transfer is ongoing. From &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.1.pdf#page=138"&gt;documentation&lt;/a&gt;:&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p style="padding-left:30px;"&gt;Before the CPU can safely update the RXDPTR and TXDPTR pointers it must first acquire the SPI semaphore. The CPU can acquire the semaphore by triggering the ACQUIRE task and then receiving the ACQUIRED event. When the CPU has updated the RXDPTR and TXDPTR pointers the CPU must release the semaphore before the SPI slave will be able to acquire it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>