<?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 reconfigure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13103/spi-master-reconfigure</link><description>Hi 
 i have an application where 3 SPI devices are connected. Each of the devices have a different CPHA/CPOL configuration. This means that, in order to make this work properly, I need to reconfigure the SPI configuration between the different peripherals</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Apr 2016 14:37:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13103/spi-master-reconfigure" /><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49964?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 14:37:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a01f23-f163-4786-84bf-bbb8da705308</guid><dc:creator>wim</dc:creator><description>&lt;p&gt;ok, will try&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49963?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 12:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab3cfcd5-a6e0-48f5-a948-efa3668f1985</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Basically if you use \nRF5_SDK_11.0.0_89a8197\examples\peripheral\spi\ as a starting point, then the clean way to change the configuration is by calling nrf_drv_spi_uninit() followed with nrf_drv_spi_init(). However if you just want to change the CPHA/CPOL configuration you could simply write new configuration directly by writing to NRF_SPI0-&amp;gt;CONFIG between nrf_drv_spi_transfer().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49966?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 11:16:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3e66e29-da42-4d01-b144-a2668c191951</guid><dc:creator>wim</dc:creator><description>&lt;p&gt;Kenneth, it is still not clear to me.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;What do you mean with &amp;#39;the driver&amp;#39;? Is that software or hardware?  In my question I meant should I enable/disable using SPI0.ENABLE register.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What do you mean with &amp;quot;&lt;em&gt;The alternative is to disable and re-enable with new setting between transactions that require change in configuration&lt;/em&gt;&amp;quot;? is that hardware or software?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The simplest for me would be to do just that register write on the fly and that&amp;#39;s it. But just wanted to know if there are side effects I need to take into account&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49965?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 09:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d099c0d-c05b-4f84-bc95-2283c3ceac80</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Most likely the hack suggested by wizath will work, in that case you directly access the peripheral and can change the SPI configuration on the fly between SPI transactions. There is no need to disable or re-enable the driver in such case. The alternative is to disable and re-enable with new setting between transactions that require change in configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49962?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 11:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c816d28-6445-44e7-8b5f-24aab1c22099</guid><dc:creator>wim</dc:creator><description>&lt;p&gt;so if enabled, i need to disable first and then re-enable?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi master reconfigure</title><link>https://devzone.nordicsemi.com/thread/49961?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 11:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2abcd7-6876-45b3-a03b-619cbc2b5a90</guid><dc:creator>wizath</dc:creator><description>&lt;p&gt;Direct register write for spi peripherial while disabled works for me.&lt;/p&gt;
&lt;p&gt;Just use:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_SPI0-&amp;gt;PSELMISO = 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or whatever option you like.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>