<?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 CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14738/spi-cs-not-toggled-during-transfer</link><description>Hello, 
 I want to connect one board trough SPI to my nRF51-DK. Using SDK11 and SD130, the nRF51-DK is the SPI master, I call the function nrf_drv_spi_transfer() but the CS Pin is never toggled. To solve this I changed it manually before and after the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jun 2016 12:51:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14738/spi-cs-not-toggled-during-transfer" /><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56269?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2016 12:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bc18ee2-a7bb-4343-8b50-13ac957a1fb8</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I was using an example code from other company and they had cleared the cs pin on a interrupt. This was causing it to be cleared right after I tried to initiate a spi transfer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56267?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 11:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ed10bf5-211b-4f44-a60c-215cc31424b4</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;the problem is it is like only a moment. and not the duration of my clock. I&amp;#39;ll try to see my code, maybe I have a &lt;code&gt;nrf_gpio_pin_set(p_cb-&amp;gt;ss_pin);&lt;/code&gt; somewhere defined that is setting high the pin. thank you for the help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56268?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 11:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:165fc97e-be24-4700-a3b8-a9382c71ba49</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well that code looks fine - it clears the pin at the start of the transaction and sets it again at the end, which is what it ought to do. It&amp;#39;s going to bounce pretty quickly between the two states because the transfers aren&amp;#39;t very long.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56266?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 09:28:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5a4d453-35bc-4996-a7a7-cb0fa4c401f9</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;The code I putted is not as it is on the SDK, I have first the code you putted and after, on the end of the transfer, with the same code but with the set of the pin. the &amp;quot;/&amp;quot; represented that I have the two codes but with that difference. I will change on the question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56265?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 09:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f500ec-168d-415e-9ebb-6555db962697</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Where is this code you&amp;#39;re seeing, because I&amp;#39;m looking at the driver in my directory and it correctly clears the pin&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (p_cb-&amp;gt;ss_pin != NRF_DRV_SPI_PIN_NOT_USED)
{
    nrf_gpio_pin_clear(p_cb-&amp;gt;ss_pin);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t see a line like you have above, it looks to me like the clear, which is correct, was commented out and replaced with a set.&lt;/p&gt;
&lt;p&gt;So what exact line of what file are you looking at and you might want to redownload the SDK and check the code didn&amp;#39;t get changed by mistake.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56264?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 09:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8daacc95-be81-49b4-abc3-823f308e914a</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;The pin selected now it&amp;#39;s the pin 3, but I already tried others with same results.
What happens is that the CS pin just goes low and goes back to high right after. So my slave can&amp;#39;t send or receive anything because the CS is always high when the CLK is active. I can&amp;#39;t debug on the nRF side because I need an external supply of 2 V to be able to connect to the other board. So I&amp;#39;m measuring the signals with an oscilloscope and there I can see that the behavior of the CS pin isn&amp;#39;t correct.
Can&amp;#39;t understand why is not clearing the CS pin for the duration of the CLK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI CS not toggled during transfer</title><link>https://devzone.nordicsemi.com/thread/56263?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 09:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab59a0d1-9264-4c9e-bdae-f5f86736d3ff</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Do you need to change what? 0xFF is the correct define for an unused pin (unused pins in registers are usually 0xFFFFFFFF so this is just the last 8 bits). What do you have your ss_pin configured to, if it&amp;#39;s not 0xFF then that piece of code will be executed and the pin will toggle low. What are you seeing different?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>