<?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>nRF52840 pinout confusion</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71660/nrf52840-pinout-confusion</link><description>I might be dense here, but please bear with me and clarify something. I am looking at the SPI bus as drawn on the nRF52840. According to the schematics (PCA10056 - nRF52840 MCU) ,the spi bus is assigned as follows: 
 
 
 So, SS, MOSI, MISO and SCK should</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Feb 2021 13:04:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71660/nrf52840-pinout-confusion" /><item><title>RE: nRF52840 pinout confusion</title><link>https://devzone.nordicsemi.com/thread/294631?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 13:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c369519-928c-4ba2-acde-999cf91809af</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you search for e.g. SPI_SCK_PIN in your project, you should see that it is used a couple of places. It is defined in sdk_config.h, and used in main.c in the unmodified SDK\examples\peripheral\spi example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.ss_pin   = SPI_SS_PIN;
    spi_config.miso_pin = SPI_MISO_PIN;
    spi_config.mosi_pin = SPI_MOSI_PIN;
    spi_config.sck_pin  = SPI_SCK_PIN;
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So there aren&amp;#39;t really any predefined SPI pins. It is just what happened to be set as a default in this example&amp;#39;s sdk_config.h file. You can set it to whatever pins you like. The intended way to modify this is to do it in the sdk_config.h file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;NB: Please take a look at the back side of your SDK before you assign any other pins for your SPI. Please note that some of the pins are used by buttons, LEDs and the NFC on the DK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]In this code example, SPI0_Enabled was selected.&amp;nbsp; Does this automatically identify the set of pins to enabled?[/quote]
&lt;p&gt;&amp;nbsp;No. SPI0 refers to the SPI instance, and you are using the first SPI instance. If you would want to add another SPI, you could use SPI1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So if the question really is how to select pin P1.xx, then this is mapped so that the P1.xx pins continues where P0.yy finished. I.e. P1.00 = 32, P1.01 = 33, P1.xx = 32+xx. There is a macro for this that you can also use (and you can use this in sdk_config.h as well), and you can see that it is already used in pca10056.h.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define MY_CUSTOM_PIN = NRF_GPIO_PIN_MAP(1, 14)&lt;/p&gt;
&lt;p&gt;The macro NRF_GPIO_PIN_MAP() is defined in nrf_gpio.h, and it just adds 32 if the first input parameter is 1.&lt;/p&gt;
&lt;p&gt;&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>