<?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>nRF52832, 2 SPI Bus usage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34948/nrf52832-2-spi-bus-usage</link><description>Hello, 
 
 I want to use 2 SPI bus with nRF52832 IC and SDK5. I can use the &amp;quot;SPI example&amp;quot; for first SPI bus. For the second SPI Bus, I think that I need to modify &amp;quot;sdk_config.h&amp;quot; file. 
 How should I modify the &amp;quot;sdk_config.h&amp;quot; file ? 
 
 Are the settings</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Jun 2018 10:53:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34948/nrf52832-2-spi-bus-usage" /><item><title>RE: nRF52832, 2 SPI Bus usage</title><link>https://devzone.nordicsemi.com/thread/134335?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 10:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de27689b-7e0a-4a32-a2f9-5d3d9cdb4ed2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Sorry if I wasn&amp;#39;t clear.&lt;/p&gt;
&lt;p&gt;Let us take the SPI_ENABLED and NRFX_SPI_ENABLED as an example:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;in apply_old_config.h, there is a section saying:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#if defined(SPI_ENABLED)&lt;br /&gt;#undef NRFX_SPI_ENABLED&lt;br /&gt;#define NRFX_SPI_ENABLED (SPI_ENABLED &amp;amp;&amp;amp; (NRFX_SPI0_ENABLED || NRFX_SPI1_ENABLED || NRFX_SPI2_ENABLED) )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let us say for simplicity that NRFX_SPI0_ENABLED is 1, so we can forget everything after &amp;quot;&amp;amp;&amp;amp;&amp;quot;. So if you have&amp;nbsp;defined both SPI_ENABLED and NRFX_SPI_ENABLED&amp;nbsp;&amp;nbsp;in sdk_config.h, then NRFX_SPI_ENABLED will always be the same as SPI_ENABLED, but if you remove (remove, and not only define to 0), all the SPI settings from sdk_config.h will be replaced by the non-nrfx defines of the SPI.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRFX_SPI_ENABLED&amp;nbsp;defined in sdk_config.h:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SPI_ENABLED defined in sdk_config.h:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; effective NRFX_SPI_ENABLED definition:&lt;/p&gt;
&lt;p&gt;1..............................................................................................1.................................................................................................1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ok&lt;/p&gt;
&lt;p&gt;1...............................................................................................0.................................................................................................0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;changed&lt;/p&gt;
&lt;p&gt;0...............................................................................................1.................................................................................................1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;changed&lt;/p&gt;
&lt;p&gt;0...............................................................................................0..................................................................................................0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ok&lt;/p&gt;
&lt;p&gt;1...............................................................................................not defined..................................................................................1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ok&lt;/p&gt;
&lt;p&gt;0...............................................................................................not defined..................................................................................0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ok&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So either give them the same values, or completely remove the definition of the non-NRFX defines in sdk_config.h.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would be careful with changing the apply_old_config.h file. You may do this of course, but be aware that it will affect all the other projects in the SDK as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832, 2 SPI Bus usage</title><link>https://devzone.nordicsemi.com/thread/134213?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 14:04:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36612ef-3b7a-4b2c-80df-8e6f644d2027</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;What do you mean by &amp;quot;&lt;span&gt;apply_old_config.h&amp;quot;. Do I need to modify that file ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832, 2 SPI Bus usage</title><link>https://devzone.nordicsemi.com/thread/134211?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 14:01:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0bde0b2-0fd2-48e6-b2f8-7b4f53227b46</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;That seems like a good start. I would suggest that you set #define SPI1_ENABLED 1 as well, if you use the SDK example. You will see why if you open the file apply_old_config.h, or just do a search for NRFX_SPI_ENABLED in your entire project, you will find how the apply_old_config.h file is implemented.&lt;/p&gt;
&lt;p&gt;Then I suppose you need to initialize the second SPI just like it is done with the first in main.c.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>