<?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 share problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35853/spi-share-problem</link><description>Hi Nordic, 
 
 I&amp;#39;m using NRF52832 to design a producation that needs four SPI interfaces. 
 The four spi peripherals are: gSensor, LCD, SPI Nor Flash, and PPG Sensor. Now I&amp;#39;m planning to make gSensor and LCD share to use SPI0, LCD uses SPI1, and PPG Sensor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Jun 2018 12:04:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35853/spi-share-problem" /><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/138100?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 12:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d957da82-2f3f-4a47-91d9-33393e750c67</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Like Ketil mentioned, the way you do is not common. Normally you use CS pin to address slaves.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the same time, what you are doing is not illegal operation. It is hard to say why&amp;nbsp;nrf_drv_spi_transfer stops. But are you not able to start your code in the debug mode and see where exactly it is stuck in this function and why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/138061?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 09:35:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1be89a3b-4fc7-432f-81de-55ad73d0ca76</guid><dc:creator>Bing</dc:creator><description>&lt;p&gt;Hi ketiljo, the hardware are already designed and cannot be changed.&amp;nbsp;And&amp;nbsp;the two spi devices do not share any pins, I have to reconfig the SPI0 before each communication start. So I want to know is there any same&amp;nbsp;&amp;nbsp;usage scenarios examples. Or anyone&amp;nbsp;else had the same problem as me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/138056?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 09:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03da623f-63e2-41cf-ae0c-ccf2bb1657c9</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;If you route MISO, MOSI and CLK to both devices and use separate CS (chip select) pins, you don&amp;#39;t need to reconfig the SPI pins at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/138001?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 06:14:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac4044de-f7df-407f-94a2-a720380b6ca3</guid><dc:creator>Bing</dc:creator><description>&lt;p&gt;Sorry, I give the wrong description of my problem. In fact, not the nrf_drv_spi_init() gives the failed error code.&amp;nbsp;But the&amp;nbsp;communication&amp;nbsp;always stops to wait for the current&amp;nbsp;transmission issued by api nrf_drv_spi_transfer() to be complete. It seems that the freuquently uinit and init SPI0 causes the problem. All the SPI0 communications start and done is in the event handler&amp;nbsp;registered by&amp;nbsp;app_sched_event_put(). The using SDK is version 11.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/137975?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 20:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d31dd41c-7be9-4927-8510-3edd896aabae</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;what error does it give? does it give&amp;nbsp;NRFX_ERROR_INVALID_STATE? If so, then the uninit was not successful for some reason. I cannot see any other reason for the _init to fail&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/137939?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 14:29:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1041e8e7-0f66-47cc-8c3d-3313625ac540</guid><dc:creator>Bing</dc:creator><description>&lt;p&gt;Thanks. I know what is SPI. My problem is I need to reconfig the spi pins(miso, mosi, sck) before a new communication start. When I do this, the nrf_drv_spi_init() return a error code not NRF_SUCCESS.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI share problem</title><link>https://devzone.nordicsemi.com/thread/137935?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 14:17:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9278cf8-a517-47a5-b464-1538ed8aedcd</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;This it not how you should use SPI. It&amp;#39;s designed to support multiple slaves. Have a look at this &lt;a href="http://www.circuitbasics.com/basics-of-the-spi-communication-protocol/"&gt;http://www.circuitbasics.com/basics-of-the-spi-communication-protocol/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use one GPIO as select pin for each slave.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>