<?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>two spi parallel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40851/two-spi-parallel</link><description>i am using nrf52832 in sdk11. I am interfacing motion sensor and spi flash memory. Both motion sensor and spi flash shares spi lines and having different chip select pin. 
 both working good individually but when i combine them i give spi instance 0 to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Dec 2018 08:21:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40851/two-spi-parallel" /><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/160673?ContentTypeID=1</link><pubDate>Fri, 07 Dec 2018 08:21:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:383fe3c4-db64-4267-89da-94f58f76b219</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;As I wrote in the last comment, it would be much easier to find the error if you could provide more information regarding the signal lines.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/159466?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 06:01:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ba8028-442b-4b58-a377-cc72293961c0</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;have you checked the code??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/159262?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 14:35:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e33f1ee2-1789-4056-8894-29eb42b92fc4</guid><dc:creator>Jared</dc:creator><description>[quote user="vohra alihussain"]yes there is activity on spi lines...[/quote]
&lt;ul&gt;
&lt;li&gt;Could you be more specific? What are you observing?&lt;/li&gt;
&lt;li&gt;Is Chip select set properly?&lt;/li&gt;
&lt;li&gt;Is the clock correct?&lt;/li&gt;
&lt;li&gt;What are you observing on the data lines?&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/159226?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 12:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7258a9f-a919-40fd-99f4-532316f74067</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;i am using only one spi instance&lt;/p&gt;
&lt;p&gt;hardware is setup correct, we had confirmed with nordic...&lt;/p&gt;
&lt;p&gt;yes there is activity on spi lines...&lt;/p&gt;
&lt;p&gt;will you check the code?&lt;/p&gt;
&lt;p&gt;i am attaching the revised code..&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3034.memory.c"&gt;devzone.nordicsemi.com/.../3034.memory.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6153.memory.h"&gt;devzone.nordicsemi.com/.../6153.memory.h&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6472.main.c"&gt;devzone.nordicsemi.com/.../6472.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;spi0 is enabled in config file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/159217?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 12:27:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:478958e8-3683-4d78-bcb3-29493d01626d</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Only one SPI instance should be used for the bus.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;As already mentioned, we should ensure that your HW is setup correctly, b&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;efore debugging your code&lt;/span&gt;. Could you provide a Schematic of the design?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Can you measure if there is any activity on the lines during the SPI communication?&lt;/li&gt;
&lt;li&gt;Is Chip select set properly?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158912?ContentTypeID=1</link><pubDate>Sat, 24 Nov 2018 17:21:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60691ed5-a01d-46c1-ae86-ddd75bb3cfa3</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;sorry awneil,&lt;/p&gt;
&lt;p&gt;i am attaching the files where you can see the spi instances.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7183.main.c"&gt;devzone.nordicsemi.com/.../7183.main.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0334.memory.c"&gt;devzone.nordicsemi.com/.../0334.memory.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_mpu_5F00_spi.c"&gt;devzone.nordicsemi.com/.../nrf_5F00_drv_5F00_mpu_5F00_spi.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158879?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 15:43:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0fe5b12-39cf-44ea-b7fb-ea154601e54f</guid><dc:creator>awneil</dc:creator><description>[quote userid="72270" url="~/f/nordic-q-a/40851/two-spi-parallel/158878"]i didn&amp;#39;t check the spi lines....but they are connected correctly..[/quote]
&lt;p&gt;You need to check what is actually &lt;em&gt;&lt;strong&gt;happening&lt;/strong&gt;&lt;/em&gt; on those lines; ie, the electrical activity.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you getting a clock?&lt;/li&gt;
&lt;li&gt;Are the Chip Selects working correctly?&lt;/li&gt;
&lt;li&gt;etc, etc, ...&lt;/li&gt;
&lt;/ul&gt;
[quote userid="72270" url="~/f/nordic-q-a/40851/two-spi-parallel/158878"]are you sure both should have same instances?[/quote]
&lt;p&gt;No.&lt;/p&gt;
&lt;p&gt;The Nordic documentation is rather poor here -&amp;nbsp;I can&amp;#39; see any clear statement of what an &amp;quot;instance&amp;quot; actually represents.&lt;/p&gt;
&lt;p&gt;You could trawl through the code to see if it ends up representing one particular hardware peripheral ...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to properly post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0743._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158878?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 15:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19760938-987f-488c-86fb-a6bf1376ad8a</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;yes i debug it but nothing found.&lt;/p&gt;
&lt;p&gt;i am not getting error codes.&lt;/p&gt;
&lt;p&gt;i didn&amp;#39;t check the spi lines....but they are connected correctly..&lt;/p&gt;
&lt;p&gt;are you sure both should have same instances?&lt;/p&gt;
&lt;p&gt;i have given both spi instance id as &amp;quot;0&amp;quot;&lt;/p&gt;
&lt;p&gt;i am giving initialization fuction for both:&lt;/p&gt;
&lt;p&gt;static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(flash_SPI_INSTANCE_ID);&lt;br /&gt;uint32_t flash_init(void)&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; const nrf_drv_spi_config_t flash_config = { \&lt;br /&gt; .sck_pin = flash_SCK_PIN, &lt;br /&gt; .mosi_pin = flash_MOSI_PIN,&lt;br /&gt; .miso_pin = flash_MISO_PIN,&lt;br /&gt; .ss_pin = flash_CS_PIN,&lt;br /&gt; .irq_priority = APP_IRQ_PRIORITY_HIGH, &lt;br /&gt; .orc = 0xFF, &lt;br /&gt; .frequency = NRF_DRV_SPI_FREQ_1M, &lt;br /&gt; .mode = NRF_DRV_SPI_MODE_0, &lt;br /&gt; .bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST, &lt;br /&gt; };&lt;br /&gt; &lt;br /&gt; return nrf_drv_spi_init(&amp;amp;spi, &amp;amp;flash_config,spi_event_handler); &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uint32_t nrf_drv_mpu_init(void)&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; const nrf_drv_spi_config_t spi_mpu_config = { \&lt;br /&gt; .sck_pin = MPU_SPI_SCL_PIN, &lt;br /&gt; .mosi_pin = MPU_SPI_MOSI_PIN,&lt;br /&gt; .miso_pin = MPU_SPI_MISO_PIN,&lt;br /&gt; .ss_pin = MPU_SPI_CS_PIN,&lt;br /&gt; .irq_priority = APP_IRQ_PRIORITY_HIGH, &lt;br /&gt; .orc = 0xFF, &lt;br /&gt; .frequency = NRF_DRV_SPI_FREQ_1M, &lt;br /&gt; .mode = NRF_DRV_SPI_MODE_0, &lt;br /&gt; .bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST, &lt;br /&gt; };&lt;br /&gt; &lt;br /&gt; return nrf_drv_spi_init(&amp;amp;m_spi_instance, &amp;amp;spi_mpu_config, nrf_drv_mpu_spi_event_handler); &lt;br /&gt;}&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158873?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 15:12:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d772292-944e-44c1-85db-cdd98e79fee6</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So what testing / investigation / debugging have &lt;em&gt;&lt;strong&gt;you&lt;/strong&gt;&lt;/em&gt; done to find what&amp;#39;s going on?&lt;/p&gt;
&lt;p&gt;Are you getting any error codes?&lt;/p&gt;
&lt;p&gt;Are the SPI lines behaving correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158871?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 15:08:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a47656-24af-4e61-be75-5c7a9806d473</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;i don&amp;#39;t know, but i tried to give them same spi instance &amp;quot;0&amp;quot;,but only one device works...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two spi parallel</title><link>https://devzone.nordicsemi.com/thread/158869?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 15:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba49510c-ab01-44c9-8a5a-41d2ea67dea3</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;If they share the same SPI lines then, surely, they must be sharing the same SPI instance ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>