<?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>Using GPIO as button</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56770/using-gpio-as-button</link><description>Hello, 
 I am trying to understand how to use an external button. In the first stage I am trying to replace the functionality of button0 on the DK with a GPIO. 
 I took the peripheral\BSP example and made the following changes: 
 1. pca10056.h: 
 I replaced</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Feb 2020 14:12:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56770/using-gpio-as-button" /><item><title>RE: Using GPIO as button</title><link>https://devzone.nordicsemi.com/thread/233317?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 14:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44c9631b-6faa-4e61-b176-9c066b2728da</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested with the changes he posted in DevZone, it is working fine. I get a BSP_EVENT_KEY_4 event when I connect P1.06 to GND (We tested in this way because we don&amp;#39;t have an external button).&amp;nbsp;I did not use nrf_gpio_cfg_input(newPin, NRF_GPIO_PIN_PULLUP); in main. I do not see what good that should do, but he BSP library will configure the buttons correctly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using GPIO as button</title><link>https://devzone.nordicsemi.com/thread/230280?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 09:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32cdcf5e-b222-4125-b87e-db75b383ff16</guid><dc:creator>matan</dc:creator><description>&lt;div&gt;I now have a different problem. I can replace one of the existing buttons with my external button but I don&amp;#39;t succeed to use it in addition to the existing ones.&lt;br /&gt;Here are the changes I made.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In pca10056.h:&lt;br /&gt;==============&lt;br /&gt;modified:&lt;br /&gt;&amp;nbsp;&amp;nbsp; #define BUTTONS_NUMBER 5&lt;br /&gt;added:&lt;br /&gt;&amp;nbsp;&amp;nbsp; #define BUTTON_5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_GPIO_PIN_MAP(1,6)&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;#define BUTTONS_LIST { BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4, BUTTON_5 }&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;#define BSP_BUTTON_4&amp;nbsp;&amp;nbsp; BUTTON_5&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In sdk_config.h:&lt;br /&gt;================&lt;br /&gt;modified:&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 5&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In main.c:&lt;/div&gt;
&lt;div&gt;========&lt;br /&gt;Added:&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;#define newPin NRF_GPIO_PIN_MAP(1, 6)&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;inside bsp_evt_handler():&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;case BSP_EVENT_KEY_4&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;in main():&lt;br /&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;nrf_gpio_cfg_input(newPin, NRF_GPIO_PIN_PULLUP);&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using GPIO as button</title><link>https://devzone.nordicsemi.com/thread/230006?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 08:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe7b7b54-f9a0-4de8-981f-f160f432e224</guid><dc:creator>matan</dc:creator><description>&lt;p&gt;I used the VDD from the board instead of the 5V. It works fine now, thanks for the help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using GPIO as button</title><link>https://devzone.nordicsemi.com/thread/229944?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2020 18:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db05ef24-1c17-4a39-8b51-977a0bf555ce</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="85770" url="~/f/nordic-q-a/56770/using-gpio-as-button"]I expected that whenever I connect the 5V on the board to pin 1.3[/quote]
&lt;p&gt;I expect the &amp;micro;C to blow up..&lt;/p&gt;
&lt;p&gt;SCNR&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;NRF5x chips do not allow 5V on GPIO pins - see absolute maximum ratings in the PS.&lt;/p&gt;
&lt;p&gt;Also, a button that is configured with a pullup enabled will be active &lt;strong&gt;low&lt;/strong&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>