<?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 SPI slave CSN</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3258/nrf51822-spi-slave-csn</link><description>I&amp;#39;m using the nRF51822 as SPI slave. My CSN is of wrong polarity (active high). Is it possible to change the settings in spi_slave.c to make it work anyway?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jul 2014 09:45:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3258/nrf51822-spi-slave-csn" /><item><title>RE: nRF51822 SPI slave CSN</title><link>https://devzone.nordicsemi.com/thread/11911?ContentTypeID=1</link><pubDate>Mon, 28 Jul 2014 09:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbc5a1a3-b1be-47f0-bc36-525d12c8171d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Unfortunately, it is not possible to change the polarity of the CSN line in the SPIS module.
You could try one of these options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use an external inverter on the CSN line.&lt;/li&gt;
&lt;li&gt;Use two additional GPIOs to emulate an inverted CSN line in firmware.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can setup GPIOTE channel or PORT event, port event does not require 16M, so it&amp;#39;s more power efficient with the &amp;quot;CSN manipulation&amp;quot;.
Setup GPIO x with SENSE_HIGH interrupt, GPIO y as output, and GPIO z as the SPIS CSN line.
GPIO y and GPIO z must be connected on your PCB.&lt;/p&gt;
&lt;p&gt;When the external CSN goes high, it will trigger a GPIOTE event (PORT or using a channel).
In the GPIOTE event, you set GPIO y to &amp;#39;0&amp;#39; and it will again trigger the SPIS CSN line.&lt;/p&gt;
&lt;p&gt;When the transaction is finished (master CSN is inactive), set GPIO y to &amp;#39;1&amp;#39; again.&lt;/p&gt;
&lt;p&gt;Best regards,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>