<?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 pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16754/spi-pin-on-nrf51-dk</link><description>Hi All, 
 I have a question about the SPI pin number on nrf51 Dk. 
 I don&amp;#39;t understand when i look into the pca10028.h file, i see this mapping: 
 #define SPIM0_SCK_PIN 4
#define SPIM0_MOSI_PIN 1
#define SPIM0_MISO_PIN 3
#define SPIM0_SS_PIN 2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Mar 2017 08:53:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16754/spi-pin-on-nrf51-dk" /><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64077?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 08:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2028fded-f52a-4c5d-b3ac-ba9e1de927b1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The SPI PCA10028 examle in SDK 11 use SPI instance 0, with the following default config in &lt;em&gt;nrf_drv_config.h&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SPI0_CONFIG_SCK_PIN 1
#define SPI0_CONFIG_MOSI_PIN 2
#define SPI0_CONFIG_MISO_PIN 3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;#define SPI_CS_PIN 4&lt;/code&gt; with this configuration should therefore not be an issue, unless you have made any changes to &lt;em&gt;nrf_drv_config.h&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64078?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 15:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10b9d680-bdc5-40ea-bc96-09a84c5f8cb0</guid><dc:creator>anthony</dc:creator><description>&lt;p&gt;Hi,
i used the SDK_v11 and in the example &amp;quot;peripheral\spi\pca10028&amp;quot; in the main, it&amp;#39;s written :
&lt;strong&gt;nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG(SPI_INSTANCE);
spi_config.ss_pin = SPI_CS_PIN;  (SPI_CS_PIN = 4)&lt;/strong&gt;
so there&amp;#39;is a problem, because in the nrf_drv_config.h the pin 4 is used for the MISO signal.
So what is the pin number of the CS (chipselect)?&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64076?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 11:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce639997-8199-4adc-a9a6-c8cf924a904e</guid><dc:creator>Yacire</dc:creator><description>&lt;p&gt;Thanks Jorgen, it&amp;#39;s very clear now, how SPI pin definition works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64075?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 11:08:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:965ffef3-e2df-4d60-b2ae-d59a7a8d5cbd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, in the SPI Loopback example in SDK10 it is correct that the pins from BSP is used. If you look at the function &lt;code&gt;spi_master_init(..)&lt;/code&gt; in main.c, you can see that the &lt;code&gt;nrf_drv_spi_config_t&lt;/code&gt; is set to use the pin numbers defined in pca10028.h. If you change the example to use the default config using &lt;code&gt;nrf_drv_spi_config_t config = NRF_DRV_SPI_DEFAULT_CONFIG(0);&lt;/code&gt;, as described in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/hardware_driver_spi_master.html?cp=4_0_2_2_7"&gt;spi master driver documentation&lt;/a&gt;, the pins from the defined in nrf_drv_config.h would have been used. It all depends on how the SPI interface is configured.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64074?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 17:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1015d473-7e5c-40c9-a2dc-f7c4a94324e1</guid><dc:creator>Yacire</dc:creator><description>&lt;p&gt;Are you sure ?&lt;/p&gt;
&lt;p&gt;I tested the SPI Master LoopBack example and it is the pins defined in the bsp.h file who are used for SPI... Not those in the nrf_drv_config.h&lt;/p&gt;
&lt;p&gt;Can you test the example in the SDK 10 ? connect pin 1 and 3 for SPI0, and 12 and 14 for SPI1 and it works.&lt;/p&gt;
&lt;p&gt;But if you look in the nrf_drv_config, you can see the SPI0 and SPI1 are enabled and the pin mapping is the same:  pin 2 3 and 4.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand.
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64072?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a9fc2b4-ca9c-4fba-8f7e-537a2612f8ab</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;No, the defines in nrf_drv_config.h is used to setup the SPI interface (given that you are using the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/hardware_driver_spi_master.html?cp=4_0_1_2_12"&gt;SPI master driver&lt;/a&gt;). If you want to use the pins defined in BSP, you need to change the defines in nrf_drv_config.h to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#define SPI0_CONFIG_SCK_PIN SPIM0_SCK_PIN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#define SPI0_CONFIG_MOSI_PIN SPIM0_MOSI_PIN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#define SPI0_CONFIG_MISO_PIN SPIM0_MISO_PIN&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64073?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 09:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d883cf6-d014-4f3f-8426-944ee2e6bbf3</guid><dc:creator>Yacire</dc:creator><description>&lt;p&gt;Thanks for your answer Jorgen,&lt;/p&gt;
&lt;p&gt;But i use bsp.h file, so my pin for the SPI interface are those defined in the pca10028.h right ?
The pin defined in the nrf_drv_config.h are used if i don&amp;#39;t use the bsp.h file ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI pin on nrf51 DK</title><link>https://devzone.nordicsemi.com/thread/64071?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 06:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61176390-46b6-40dd-8445-dd5caefdceaf</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The pins on nRF51 (and nRF52) chips are reconfigurable via pin crossbar, meaning you can use any of the GPIO pins for any peripheral like SPI, UART, TWI, etc.&lt;/p&gt;
&lt;p&gt;The defines in pca10028.h is just defines for default pinouts on the PCA10028 board, to easily be able to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/sdk_for_custom_boards.html?cp=4_0_0_1_4"&gt;support for new boards in SDK&lt;/a&gt;. This is enabled by the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/lib_bsp.html?cp=4_0_0_3_4"&gt;Board Support Package&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The macros in nrf_drv_config.h is the actual &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.1%2Fhardware_driver_spi_master.html&amp;amp;cp=4_0_0_2_7"&gt;configuration of the interface&lt;/a&gt; and its pins. If you change the pin numbers here, the new pins will be used for the SPI interface.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>