<?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>GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11099/gpio-does-not-sense-button-press</link><description>I have a project that uses the nRF51822_xxAA chip with a pull-up button connected to pin 9. Using a meter, I have verified that the pin drops low (0 V) when the button is pressed so I&amp;#39;m confident that the button hardware is working. However I get no response</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Jan 2016 16:19:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11099/gpio-does-not-sense-button-press" /><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41554?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2016 16:19:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71e2ae28-4c3d-4518-8d9c-93f1a4016d07</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;That is pretty funny that it happened to work out that way. No wonder I was so confused. Thanks for clarifying that. It totally makes sense that it should use logical pins. I appreciate the clarification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41555?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2016 06:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fba7d64-61e6-4835-a234-0d24a67a739b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I can guarantee you with 100% certainly that the pin assignments everywhere are logical pins and not physical pins. Physical pin numbers are used nowhere except by the guy designing the circuit diagram.&lt;/p&gt;
&lt;p&gt;Firstly if that were not the case you&amp;#39;d have to recompile software depending on the actual chip package on the board, and you don&amp;#39;t, as long as inputs and outputs are connected to the physical pin with the same logical assignment.&lt;/p&gt;
&lt;p&gt;If you look at the documentation for, for instance, the UART it specifies there that the pin number can be [0..31] or 0xffffffff for disconnect, 0-31, that&amp;#39;s a logical pin number. You can&amp;#39;t put 56 in there, it&amp;#39;s not an allowed value.&lt;/p&gt;
&lt;p&gt;Your UART works by the fluke that the TX pin you specify, 54, when mod 32 == 22 which happens to be the actual logical TX pin. The rest of your pins are set to P24, P20 and P18, but having TX connected makes it appear to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41553?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2016 05:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2128b4f-3779-4770-9c9e-451932ce76f2</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;I have to disagree. I specify my UART connection (used by app_trace and the UART library) as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define RX_PIN_NUMBER  56
#define TX_PIN_NUMBER  54
#define CTS_PIN_NUMBER 52
#define RTS_PIN_NUMBER 50
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which are physical pins corresponding to logical P0_08, P0_22, P0_23, and P0_28. This is what I was talking about when I said things are not consistent. If everything used logical pins I would have had to use 8, 22, 23, and 28 but my UART works fine using physical pin numbers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41552?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2016 01:41:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03565c32-db38-466f-8e7c-dedeaedd7311</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Everything, including the UART and other drivers take the logical pin number, absolutely nothing takes the physical pin number. So you use the logical pin number everywhere, it&amp;#39;s very consistent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41551?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2016 00:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0d8cf34-65dd-4528-877c-1f6c273eeb82</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;I have actually discovered what the problem what. It turns out the GPIOTE functions expect the internal pin number (i.e. P0_17) and not the physical pin number. In my case the physical pin number was 9 which internally was P0_17. Replacing the &amp;quot;9&amp;quot; with &amp;quot;17&amp;quot; allows it to get the button state. This is very confusing especially when you consider that other GPIO functionality want the physical pin numbers (i.e. UART).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41541?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2016 16:44:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:593fbbd1-09f7-4204-b9ae-a35791070c89</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I think if you move &lt;code&gt;nrf_gpio_cfg_sense_input(BUTTON_0, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);&lt;/code&gt; after app_gpiote_user_enable() it will fix your issue. app_gpiote_user_register() cleares all GPIO sense settings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41549?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2016 08:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36066ec7-2ed8-483c-b9fa-d95969505e2a</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;I think we can be more in sync with our tests if we both work on PCA10028. When you have things work there, you can move on to the ISP130301. On PCA10028, the pin_change_int example should work out of the box. Just start with the standard board and the default example to see if that works. If that works, then you can take baby steps towards your own code to see where things start to fail.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41550?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2016 22:34:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ff00997-a415-4f71-8168-4705e3921f2f</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;The project is actually using a Insight package (ISP130301) that includes an nRF51822 chip. It is supposed to be 100% compatible. I do have a PCA10028 that I can try it on just to rule out a software issue but my latest test code is pretty simple (based on the pin_change_int example) so I&amp;#39;m not sure what could be going on. Also, I think I mentioned before that the UART does work for me but it is not connect to the &amp;quot;usual&amp;quot; pins (it is connected to pins 50, 52, 54, and 56) so I know GPIO works in general on this design.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41548?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2016 09:37:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09bbddfe-3915-45bc-9600-8187ba33a111</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Brent. You mention dev kit, is that the nRF51-DK (PCA10028)? If you have the PCA10028 we should first get things working on the PCA10028 and then move over to your custom board. The pin_change_int example should work out of the box with PCA10028. If it does not work, get a new copy of nRF51 SDK 10.0.0 and try again. When you press button 1, LED_1 should toggle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41547?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 18:50:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:759bf829-6608-4cfa-8250-10fd0ae343c0</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;Yes, I realize this example does not use the softdevice. I have tried the example both with and without the softdevice with no luck. The interrupt routine is never reached (I set a breakpoint there to check since I have no LED on this board). I know the main and gpio_init is working because I can break and trace through the code. It is simply not working within the GPIO driver somewhere as far as I can tell.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41546?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2016 15:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:366a8b03-9595-4eb1-936c-69282c625512</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Perhaps there is a little misunderstanding. The pin_change_int example in the SDK does not use the softdevice, so the procedure is to erase the chip (with e.g. pressing the &amp;quot;Erase All&amp;quot; button in nRFgo Studio), and then program only the pin_change_int example (no softdevice).&lt;/p&gt;
&lt;p&gt;If you want to make this work with the softdevice, you should program the softdevice first in nRFgo studio (e.g. the S110 8.0.0), then flash any of the BLE examples in the SDK (for S110 if you have programmed the S110 softdevice). When you have that working, you can add the pin_exchange_int code to the BLE example.&lt;/p&gt;
&lt;p&gt;Most BLE examples however have already configured the Board Support Package library in order to detect button presses. In that case, you can detect button presses as described in &lt;a href="https://devzone.nordicsemi.com/tutorials/13/"&gt;this tutorial&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41543?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2016 04:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35375ba2-3af6-43e9-ad29-7701878a7d7e</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;Thanks for the suggestion. I tried the pin_change_init example (removing the output LED code) and it also does not work. A breakpoint set on the handler is never reached. Does anyone know if using the softdevice would cause issues here? I&amp;#39;m not calling the softdevice but I wonder if it may be intercepting the GPIO data??? I&amp;#39;m going to try it without the softdevice installed and see what happens (this didn&amp;#39;t help on my previous experiments).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41545?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2016 16:08:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14d2f058-9dac-44c8-99c0-eac88eee7e74</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;In think it should work with SDK 8.0.0, but with SDK 10.0.0, you need to use the drivers. Try the pin_change_int example in nRF51 SDK 10.0.0 which configures a single button to toggle a LED&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41544?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2016 07:08:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b13319e-b938-47f4-a4b3-a3194cce9b86</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;Thanks for the feedback.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not using any of the BSP functionality for this board. It&amp;#39;s actually a really simple board with only one button, that&amp;#39;s why it&amp;#39;s so confusing why this is not working.&lt;/p&gt;
&lt;p&gt;I did try the simple example with the same result - the button does not register as being pressed. I&amp;#39;ve also tried with the dev kit with soldered on pull up and button with the same result. I&amp;#39;m wondering if there is something about using pin 9??? I do have a UART working for debug information that is mapped to other pins so I know GPIO does work for this application. Anyway, I&amp;#39;m digging into the nordic code further to see if I can isolate where it&amp;#39;s failing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO does not sense button press</title><link>https://devzone.nordicsemi.com/thread/41542?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 13:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16814a72-adc6-4905-81eb-0971cb2ed782</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Brent&lt;/p&gt;
&lt;p&gt;Would it be suitable for you to use &lt;a href="https://devzone.nordicsemi.com/tutorials/13/"&gt;Board Support Package&lt;/a&gt; to detect button presses? It should be easy to use. In e.g. ble_app_template project in nRF51 SDK 10.0.0 there is a callback function (bsp_event_handler) for the buttons on the PCA10028 board that works without modification. To get a response on a button connected to pin P0.09, just modify the BUTTON_1 configuration in the pca10028.h file to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BUTTON_1       9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then when you press your custom button you should get an event BSP_EVENT_KEY_0&lt;/p&gt;
&lt;p&gt;Otherwise, to detect a button press in a simple way, you could look at &lt;a href="https://github.com/NordicSemiconductor/nrf51-powerdown-examples/blob/master/system-on-wakeup-on-gpio/main.c"&gt;this simple example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>