<?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 protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34428/spi-protocol-configuration-how-to-change-spi0-master-into-spis0-slave-in-running-time</link><description>Hi all 
 I use nRf52840 with SDK 15.0. It allows SPI SPIS and TWI (i2c) ,but almost 3 items in the same time. I want to use spi0 as master to configurate my other mcu and change to spis 0 as a receiver to receive data from this mcu. but the macro can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 May 2018 15:00:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34428/spi-protocol-configuration-how-to-change-spi0-master-into-spis0-slave-in-running-time" /><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132323?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 15:00:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ba81a47-3950-4cd0-a159-9fcadb9c7575</guid><dc:creator>Sad~Sugar</dc:creator><description>&lt;p&gt;thanks a lot. however I have used all the 3 SPI-TWI moudles, 1 i2c 2 spi-slave at runtime. I need one more spi master to configure 2 mcu. It seem that I have to write a simulate IO SPI-master.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132250?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 11:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62c6ca59-dfe1-4295-9d61-a203c323e91e</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;You can change the pin configuration at runtime, and you can ENABLE and DISABLE peripherials.&lt;/p&gt;
&lt;p&gt;Not sure if NRF DRV functions work correctly in this case, I would just set those PSEL.XXX registers directly.&lt;/p&gt;
&lt;p&gt;I suggest using different instances (look at the base address in manual) for the master and the slave, this way you would only change the connect bit in the corresponding PSEL register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132237?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 10:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d90ee891-b603-4f1a-8898-fe4676963e01</guid><dc:creator>Sad~Sugar</dc:creator><description>&lt;p&gt;If I can&amp;#39;t change SPI into SPIS in running time, I would write a&amp;nbsp;simulation SPI master to download firmware to my mcu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132235?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 10:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51e3c4ec-d358-45a3-b295-cc33bc566fb5</guid><dc:creator>Sad~Sugar</dc:creator><description>&lt;p&gt;1. I need to download firmware to mcu with 52840 master before mcu work.&lt;/p&gt;
&lt;p&gt;2. I checked SDK code, and find that the data len is size_t (uint32) type in bottom code, so I changed the top code from uint8 to&amp;nbsp;&lt;span&gt;size_t&amp;nbsp;. Now I can transmit&amp;nbsp;size_t length data max in one time.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132233?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 10:32:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7e48364-04b9-45fb-ba4b-900ee5cf707a</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;So just use the NRF52 always as a slave. Problem solved.&lt;/p&gt;
&lt;p&gt;Make the other MCU pull its configuration data over SPI as the master.&lt;/p&gt;
&lt;p&gt;You will need a properly thought out protocol anyway, because of the restrictions in the NRF52 SPIS (&amp;lt;=255 data bytes, CS handling, etc).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132228?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 10:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73db1ee6-aa0b-404c-801b-d98e933ed59c</guid><dc:creator>Sad~Sugar</dc:creator><description>&lt;p&gt;I know SPI. I need a real time communication in my project. My mcu is the producer, bursts&amp;nbsp;real time data and transmit to nrf52840. If I use 52840 as master. I need to try to read data all the time to keep real time. It&amp;#39;s&amp;nbsp;unreasonable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?</title><link>https://devzone.nordicsemi.com/thread/132227?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 10:11:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9397e764-f3e6-40c0-90da-aaf53f597494</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;That does not sould like you understood SPI in the first place. SPI &lt;em&gt;always&lt;/em&gt; transmits and receives at the same time - you will typically just throw away the data from the path you don&amp;#39;t need.&lt;/p&gt;
&lt;p&gt;The clock signal defines which party is the master: The clock generator is called SPI master, the clock receiver is called the SPI slave. You don&amp;#39;t want to mix roles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>