<?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>Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18554/custom-board-pin-mapping</link><description>Hi Nordic Team! 
 After developing our firmware on the nRF52 HDK, we designed our custom board, and we&amp;#39;re starting to write our custom board configuration file. 
 The main problem I have is that there&amp;#39;s no official documentation on how to do this. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Aug 2017 11:32:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18554/custom-board-pin-mapping" /><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71609?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2017 11:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db4944f8-c3b9-48de-af4f-f706fabb6d2b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You need to move 0R resistor from R25/R26 to R27/R28 if you want the GPIOs to be connected to the pin headers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71608?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2017 10:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2966f4a0-b922-49b9-87c5-746ff0fd5dcc</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;I guess I need to remove resistors R25 and R26 as it is stated here:  &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52_dev_kit%2Fhw_nfc.html&amp;amp;cp=2_2_2_5_10"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;  I need to do this in order to make a proper evaluation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71607?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 16:49:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1cf566-92ba-435e-8cb4-a09f356d55a3</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;Did this last solution for using the NFC pins as gpio worked ? I am using the nrf52 DK and it does not work properyl! Is there anything else needed besides setting this flag? I am flashing the uc through armgcc, so what I basically do is to add the &lt;code&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/code&gt; on the makefile.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71606?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 15:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a3f6ef0-29d1-4dbb-8067-6d380433dbe1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I would recommend that you add the flags &lt;code&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/code&gt; and remove the flag &lt;code&gt;CONFIG_GPIO_AS_PINRESET&lt;/code&gt; from your makefile.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71605?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 15:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16fd1374-92e4-4b49-b384-f886204cd420</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I would recommend doing something like this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;pca10040.h/custom_board.h&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TWI0_SCL_PIN             11
#define TWI0_SDA_PIN             12
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;nrf_drv_config.h&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TWI0_ENABLED 1

#if (TWI0_ENABLED == 1)
#define TWI0_USE_EASY_DMA 1

#define TWI0_CONFIG_FREQUENCY    NRF_TWI_FREQ_100K
#define TWI0_CONFIG_SCL          TWI0_SCL_PIN             
#define TWI0_CONFIG_SDA          TWI0_SDA_PIN             
#define TWI0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TWI0_INSTANCE_INDEX      0
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;main.c&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static const nrf_drv_twi_t m_twi0 = NRF_DRV_TWI_INSTANCE(TWI0_INSTANCE_INDEX);

const nrf_drv_twi_config_t twi0_config  = NRF_DRV_TWI_DEFAULT_CONFIG(TWI0_INSTANCE_INDEX);

//   You can also configure pins manually:
//
//   const nrf_drv_twi_config_t twi0_config = {
//      .scl                = 11,
//      .sda                = 12,
//      .frequency          = NRF_TWI_FREQ_100K,
//      .interrupt_priority = APP_IRQ_PRIORITY_HIGH
//   };

nrf_drv_twi_init(&amp;amp;m_twi0, &amp;amp;twi0_config , twi_handler, NULL);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71604?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 15:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:379bca9b-9b22-44d7-98bd-e6b7d47300ef</guid><dc:creator>Rodrigo Lorenzo Leal</dc:creator><description>&lt;p&gt;Jørgen.&lt;/p&gt;
&lt;p&gt;So If I create a &lt;code&gt;custom_board.h&lt;/code&gt; file and for example, initialize a TWI interface (in my app) assigning the correspondent pin defined in the &lt;code&gt;custom_board.h&lt;/code&gt; file, it will suffice?&lt;/p&gt;
&lt;p&gt;Also, and sorry to be this repetitive, how can I configure the NFC and the nRESET pin (P0.21) to work as GPIO?&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71603?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 15:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e397cdef-032c-4b97-80a2-9ba6f0466401</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I understand that this can be a bit confusing, as there are a lot of defines and not always that easy to figure out which one is used. In the end, it is the pins configured in the initialization of the module that will be used. The pins defined in &lt;code&gt;nrf_drv_config.h&lt;/code&gt; is the &lt;em&gt;default&lt;/em&gt; pins used when initializing an interface without providing a configuration structure. The defines in the board header file can be used to set the defaut pins in &lt;code&gt;nrf_drv_config.h&lt;/code&gt; or in any other source file, but you are not required to use these defines, you can just as well use pin numbers or defines set somewhere else in the code. Changing the defines in the board header does not have any effect unless they are used somewhere else in the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71602?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 15:00:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d64781b-5a11-4b24-add1-75bdda69e053</guid><dc:creator>Rodrigo Lorenzo Leal</dc:creator><description>&lt;p&gt;I forgot to write this on my previous comment.&lt;/p&gt;
&lt;p&gt;Since I only have one button, and all the LED&amp;#39;s in my system are access trough a I2C I/O expander, I&amp;#39;m not planning in using the BSP. Is this OK or I need to define a BSP file for my custom board?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71601?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 14:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6919735-4997-4bc1-973d-98e91303f340</guid><dc:creator>Rodrigo Lorenzo Leal</dc:creator><description>&lt;p&gt;Jørgen.&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I already created custom_board.h file according to my hardware design. I don&amp;#39;t really understand how to map this in the &lt;code&gt;nrf_drv_config.h&lt;/code&gt; .  For example, in the &lt;code&gt;pca_10040.h&lt;/code&gt; file, the SCL and SDA pins are define as pin number 27 and 26, yet in the &lt;code&gt;nrf_drv_config.h&lt;/code&gt; they&amp;#39;re define like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TWI0_ENABLED 1

#if (TWI0_ENABLED == 1)
#define TWI0_USE_EASY_DMA 0

#define TWI0_CONFIG_FREQUENCY    NRF_TWI_FREQ_100K
#define TWI0_CONFIG_SCL          0
#define TWI0_CONFIG_SDA          1
#define TWI0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TWI0_INSTANCE_INDEX      0
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, how and where (&lt;code&gt;custom_board.h&lt;/code&gt; or &lt;code&gt;nrf_drv_config.h&lt;/code&gt;) do I configure the NFC and the nRESET pin (P0.21) to work as GPIO?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Board Pin Mapping</title><link>https://devzone.nordicsemi.com/thread/71600?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 14:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ea323f0-63b1-4f70-a350-dbca3a7d4d5b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are not required to create a &lt;em&gt;custom_board.h&lt;/em&gt;, but it is convenient to have all peripheral pin defines in a common file. This also makes it easier to switch between different boards, given that the rest of the source files is setup to use the common defines. There is a short description of how to create the file &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/sdk_for_custom_boards.html?cp=4_0_3_1_5_2#custom_board_support"&gt;here&lt;/a&gt;, but I would recommend that you start with the &lt;em&gt;pca10040.h&lt;/em&gt; board file if you have developed your firmware using the nRF52 DK.&lt;/p&gt;
&lt;p&gt;You can use the defined from &lt;em&gt;custom_board.h&lt;/em&gt; in &lt;em&gt;nrf_drv_config.h&lt;/em&gt;, for configuration of TWI, UART etc. As the NFC and reset pins have special functions, they have to be configured if you want to use these for general GPIO.&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>