<?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>Pin 20 cannot pullup</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78922/pin-20-cannot-pullup</link><description>Hi, I&amp;#39;m using the BC805M EK (nRF52805) . I would like to pull up pin 20. Here is my configuration in pca10040.h. However, pin20 cannot be pulled up. It&amp;#39;s always pulled down. 
 
 If I delete all codes in the main loop, pin 20 is pulled up to 1.65V. Why</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Sep 2021 06:53:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78922/pin-20-cannot-pullup" /><item><title>RE: Pin 20 cannot pullup</title><link>https://devzone.nordicsemi.com/thread/331418?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 06:53:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5e15afd-147c-42d3-8c1f-86e7f771c92e</guid><dc:creator>StevenW807</dc:creator><description>&lt;p&gt;Problem solved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Because I added my custom functions to the nRF52805 board (e.g. power ON/OFF button) from one of BLE example projects, which is built for nRF52832. Some buttons were configured by BLE functions by default.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Firstly, we need to change pca10040.h file.&amp;nbsp;&lt;/strong&gt;An example is:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// The code will save the following 2 buttons as an array
// So button0 in the array is pin 20
// and button1 in the array is pin 21

#define BUTTONS_NUMBER 2

#define BUTTON_START   20
#define BUTTON_1       20
#define BUTTON_1       21
#define BUTTON_STOP    21
#define BUTTON_PULL    NRF_GPIO_PIN_PULLUP&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Then, we need to read the bsp_btn_ble.c file.&lt;/strong&gt; Some LEDs and buttons were configured in BLE functions by default (e.g. connect, disconnect BLE buttons). If you would like to use the button for custom functions, you might&amp;nbsp;need to modifty/delete&amp;nbsp;the button functions in&amp;nbsp;&lt;span&gt;bsp_btn_ble.c. For example,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BTN_ID_WAKEUP             1  /**&amp;lt; ID of button used to wake up the application. */
#define BTN_ID_SLEEP              1  /**&amp;lt; ID of button used to put the application into sleep mode. */
#define BTN_ID_DISCONNECT         1  /**&amp;lt; ID of button used to gracefully terminate a connection on long press. */
#define BTN_ID_WAKEUP_BOND_DELETE 1  /**&amp;lt; ID of button used to wake up the application and delete all bonding information. */
#define BTN_ID_WHITELIST_OFF      1  /**&amp;lt; ID of button used to turn off usage of the whitelist. */&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After doing the above 2 steps, my button pin is pulled to HIGH by default. The power ON/OFF button works well now. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, plz Remember to add a debouncing capacitor for your button on PCB as well.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pin 20 cannot pullup</title><link>https://devzone.nordicsemi.com/thread/327692?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2021 05:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32808db6-bba2-45da-9d0c-a2e9ac1a4fe2</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What if you just configure the pin through the nrf_gpio library, like this?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;nrf_gpio_cfg_input(20, NRF_GPIO_PIN_PULLUP);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Will it still not be pulled up correctly?&lt;/p&gt;
&lt;p&gt;Can you show me the rest of the code where you initialize the button library?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pin 20 cannot pullup</title><link>https://devzone.nordicsemi.com/thread/327513?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 05:48:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1e0d2b3-9081-40e1-94db-2a935e22cc8e</guid><dc:creator>StevenW807</dc:creator><description>&lt;p&gt;Sorry for the confusion. Pin 21 actually connected with a button, NOT LED. I have fixed the wrong symbol image.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pin 20 cannot pullup</title><link>https://devzone.nordicsemi.com/thread/326574?ContentTypeID=1</link><pubDate>Wed, 25 Aug 2021 13:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a5250a5-1d7b-4099-b2a0-e307fca16399</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks like P0.20 is connected to a LED in your schematic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Why do you want to configure it as a button if it is connected to a LED?&lt;/p&gt;
&lt;p&gt;Can you confirm if this is correct?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>