<?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>How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98770/how-to-connect-multiple-spi-devices-to-the-same-instance</link><description>I&amp;#39;m trying to connect the same SPI instance to multiple devices in parallel(besides CS GPIO of course) - however, I tried multiple combinations without great success. 
 I&amp;#39;m using NCS v2.2.0, nRF52840 / nRF5340 as my main target MCUs 
 @ Karl Ylvisake</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Apr 2023 08:50:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98770/how-to-connect-multiple-spi-devices-to-the-same-instance" /><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/421968?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 08:50:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58729087-1cd9-47a0-a395-d0ce1f451e91</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Could you include the full errors from your build?&lt;br /&gt;Please use the&amp;nbsp;&lt;em&gt;Insert -&amp;gt; Code&amp;nbsp;&lt;/em&gt;option when sharing code or logs here on DevZone.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/421840?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 17:49:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aad9392e-3b68-4fbe-9656-24ca945fe60a</guid><dc:creator>Meh</dc:creator><description>&lt;p&gt;I have access to a logic analyzer, but I&amp;#39;m getting errors that prevent even the build of this code &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/421776?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 13:23:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e08bab3d-2f71-4b90-9df3-98de52059cda</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;Thank you for clarifying.&lt;br /&gt;&lt;br /&gt;What do you see when you attempt to communicate with each of these devices, using this setup?&lt;br /&gt;Do you have access to a logic analyzer, so that you can scope what is happening on the SPI lines, and to verify that the correct CS-gpio is being asserted as expected?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/420857?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 19:16:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:420134d6-a856-459a-97cf-1b2282edc483</guid><dc:creator>Meh</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/SPI_5F00_three_5F00_slaves_5F00_daisy_5F00_chained.svg" /&gt;&lt;/p&gt;
&lt;p&gt;This is a good illustration of my&amp;nbsp;desired use case&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/98770/how-to-connect-multiple-spi-devices-to-the-same-instance/420673"]Could you elaborate on what you have tried, and what the results have been?[/quote]
&lt;p&gt;I tried to do something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
    status = &amp;quot;okay&amp;quot;;
    pinctrl-0 = &amp;lt;&amp;amp;spi1_pins&amp;gt;;
    #address-cells = &amp;lt;1&amp;gt;;
    #size-cells = &amp;lt;0&amp;gt;;

    adg731_1: adg731_1@0 {
        compatible = &amp;quot;adi,adg731&amp;quot;;
        reg = &amp;lt;0&amp;gt;;
        spi-max-frequency = &amp;lt;DT_FREQ_KHZ(1000)&amp;gt;;
        label = &amp;quot;ADG731_1&amp;quot;;
        cs-gpios = &amp;lt;&amp;amp;gpio0 4 GPIO_ACTIVE_LOW&amp;gt;;
    };

    adg731_2: adg731_2@1 {
        compatible = &amp;quot;adi,adg731&amp;quot;;
        reg = &amp;lt;1&amp;gt;;
        spi-max-frequency = &amp;lt;DT_FREQ_KHZ(1000)&amp;gt;;
        label = &amp;quot;ADG731_2&amp;quot;;
        cs-gpios = &amp;lt;&amp;amp;gpio0 5 GPIO_ACTIVE_LOW&amp;gt;;
    };

    adg731_3: adg731_3@2 {
        compatible = &amp;quot;adi,adg731&amp;quot;;
        reg = &amp;lt;2&amp;gt;;
        spi-max-frequency = &amp;lt;DT_FREQ_KHZ(1000)&amp;gt;;
        label = &amp;quot;ADG731_3&amp;quot;;
        cs-gpios = &amp;lt;&amp;amp;gpio0 6 GPIO_ACTIVE_LOW&amp;gt;;
    };

    adg731_4: adg731_4@3 {
        compatible = &amp;quot;adi,adg731&amp;quot;;
        reg = &amp;lt;3&amp;gt;;
        spi-max-frequency = &amp;lt;DT_FREQ_KHZ(1000)&amp;gt;;
        label = &amp;quot;ADG731_4&amp;quot;;
        cs-gpios = &amp;lt;&amp;amp;gpio0 7 GPIO_ACTIVE_LOW&amp;gt;;
    };
};






&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/420673?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 07:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6406a64-95f6-4bb8-9320-5ba886e5d959</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;As Rune mentions: could you please clarify whether you mean to have multiple secondary devices on the same SPI bus (communicating with each one in series with the other), or are you looking to communicate in parallel with all the devices?&lt;br /&gt;Based on the wording of your post I will assume the former.&amp;nbsp;&lt;br /&gt;If you are using the SPIM driver then you will need to control the SS gpio yourself, since this is not done by the driver directly.&lt;br /&gt;I.e asserting the SS gpio for the specific device you are looking to communicate to, before starting the transfer.&lt;/p&gt;
[quote user=""]however, I tried multiple combinations without great success.[/quote]
&lt;p&gt;Could you elaborate on what you have tried, and what the results have been?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/420636?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 00:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82dadcd9-77a0-40bd-b3ca-64e55e8701a0</guid><dc:creator>Meh</dc:creator><description>&lt;p&gt;True that &lt;a href="https://devzone.nordicsemi.com/members/rune-warhuus"&gt;Rune Warhuus&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect multiple SPI devices to the same Instance?</title><link>https://devzone.nordicsemi.com/thread/420634?ContentTypeID=1</link><pubDate>Sun, 16 Apr 2023 22:20:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06a2c7e8-70f3-4bdb-a6ca-ef559986d4d6</guid><dc:creator>Rune Warhuus</dc:creator><description>&lt;p&gt;If you want &amp;quot;true&amp;quot; parallell communication you have to hook the devices up to different SPI controller instances, since SPI is a serial protocol (as in the name). You probably wanted to know how to communicate with multiple devices from the same controller (instance) but I just wanted to clarify first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>