<?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 Master Slave problem with CS/NCS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118177/spi-master-slave-problem-with-cs-ncs</link><description>Hi, I am trying establish connection between SPI MASTER and SPI SLAVE on two boards nRF52 DK. I am using example &amp;quot;ncs-spi-master-slave-example&amp;quot; SPI Master/Slave example 
 SDK v2.6.0, Toolv2.6.0 
 pin connections: master board: slave board: MOSI: P0.30</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Jan 2025 07:31:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118177/spi-master-slave-problem-with-cs-ncs" /><item><title>RE: SPI Master Slave problem with CS/NCS</title><link>https://devzone.nordicsemi.com/thread/519448?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 07:31:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd666942-d44a-4550-a1b0-df0ea3af5f9d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the update.&amp;nbsp;The CS signal must always be de-asserted after the transaction is complete. The delay&amp;nbsp;sets how long to wait both before and after the transaction&amp;nbsp;before asserting and de-asserting the CS signal. The scope trace you posted earlier shows that it is released way too early, which indicates that there is a problem with the configuration, but I&amp;#39;m not sure what it may be. Did you try to use the original pinout from the sample to see if you got the same result?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master Slave problem with CS/NCS</title><link>https://devzone.nordicsemi.com/thread/519128?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 15:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3fa5e51-635c-44b6-88e7-c1630ad143a1</guid><dc:creator>MartinKeySoft</dc:creator><description>&lt;p&gt;I answer myself and ask new questions.&lt;/p&gt;
&lt;p&gt;Only now I noticed that the pin used as CSN (P0.14) for SPI SLAVE is also used for BUTTON1. So I changed the pin assigned to BUTTON1 to unused pin (P0.02).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;button1 {
	gpios = &amp;lt;&amp;amp;gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also tried changing &amp;quot;.delay&amp;quot; in the configuration for SPI MASTER (spi_cfg).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static struct spi_config spi_cfg = {
	.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB | /*SPI_MODE_CPOL | SPI_MODE_CPHA*/ SPI_OP_MODE_MASTER,
	.frequency = 1000000,
	.slave = 0,
	.cs = {.gpio = MY_SPI_MASTER_CS_DT_SPEC, .delay = 20},			// MS 0 ---&amp;gt; 20
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After these changes, the example starts working, but I&amp;#39;m afraid that the &amp;quot;.delay&amp;quot; change is not intended for such purposes.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/SPI_5F00_logic-analyser02.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Is there correct solution for CS timing of the SPI MASTER? Why Button1 affects the CSN @ SPI SLAVE?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>