<?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 pins don&amp;#39;t work as expected.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29939/gpio-pins-don-t-work-as-expected</link><description>Hi to everyone! 
 I have a custom board (based on nRF52832) with two LEDS and other GPIO ports. In some point of the code I have to activate one device by setting one port to 1. This is designed like that for power saving. But I realized this device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Jan 2018 14:10:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29939/gpio-pins-don-t-work-as-expected" /><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119083?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2018 14:10:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36ca7c9f-2a98-4dfe-9976-1bb9d7f0d86c</guid><dc:creator>nemunoz</dc:creator><description>&lt;p&gt;That is why the leds are acting like that! Because LEDS_ACTIVE_STATE sets 0 as active value. I was thinking there was a list of states (I could not imagine where this list could be) and the file was taking the one that has the value 0. I am sorry for my ignorance.&lt;/p&gt;
&lt;p&gt;Now I am working with the updated SDK (14.2.0) and everything in GPIO is working properly. Maybe I modified something without realizing it in the old version and that is why GPIO was not working.&lt;/p&gt;
&lt;p&gt;Thanks for your help in everything, AmbystomaLabs!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119080?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 20:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab84ade9-bf1c-450c-b34c-d7a63f2cc09f</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;There are a lot of blog answers on BSP.
Also here is the tutorial: &lt;a href="https://devzone.nordicsemi.com/tutorials/13/board-support-package-bsp/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119082?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 19:53:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a183b28-b048-440f-953a-936644c01eee</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;Your LED issue is due to using the wrong BSP file for your board.  Without a schematic of your board you will have to guess at whether the LED&amp;#39;s sink or source to activate. Also, you could inspect it under a microscope and try to figure out the connections.&lt;/p&gt;
&lt;p&gt;LED_ACTIVE_STATE is what you expect it to be.  The definition of whether they source or sink to turn on.&lt;/p&gt;
&lt;p&gt;All the bsp definitions are here: &lt;a href="https://appiko.github.io/nrf5x-firmware-doc/group__board__pca10040.html#ga8315d68f769a028273fb5656d720196b"&gt;appiko.github.io/.../group__board__pca10040.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119081?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 19:40:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c18bd72d-c849-4f6a-8e8c-67247f98c259</guid><dc:creator>nemunoz</dc:creator><description>&lt;p&gt;I do not saying any of the examples are not working, that is why I put the word problem between quoation marks, because in the end I thought I was missing something.&lt;/p&gt;
&lt;p&gt;I am saying that I do not understand why a function to turn on a led uses clear and a function to turn it off uses set, because I guess that set puts the pin in 1 (sending current) and clear puts the pin in 0 (cleaning the current). And with this current I turn on the led or I turn off the led if I remove the current. At least I thought so until I saw how are working the leds.&lt;/p&gt;
&lt;p&gt;And I am taking the pca10040.h file as example to develop our custom board definition header file because both the custom board and the develop board use the same SoC. That is why I asked you for the meaning of LEDS_ACTIVE_STATE variable and why it&amp;#39;s own value has a number and is 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119079?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 16:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0e40c56-bffa-4468-aa2a-3418fcc54be4</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;All the examples work correctly with the development kits.  Nordic does not support module vendors.&lt;/p&gt;
&lt;p&gt;All boards need to have board definition header file that is used with boards.c to define how they are configured.  For example the nRF52832DK is pca10040.h.  You will find it in sdk/components/boards.&lt;/p&gt;
&lt;p&gt;Sounds like you are using the wrong header file.&lt;/p&gt;
&lt;p&gt;You need to go back to your board vendor and get a probably configured board file or you need to get a copy of the schematic for your board and make the correct file yourself.  The SDK is only designed for the development kits.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119078?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 10:58:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:099e58f2-5dea-4189-b576-1890925ec04e</guid><dc:creator>nemunoz</dc:creator><description>&lt;p&gt;Hi AmbystomaLabs.&lt;/p&gt;
&lt;p&gt;This is a prototype board and we are looking for the problem to fix it (yes I did not design it).&lt;/p&gt;
&lt;p&gt;But recently I have seen in deep the Nordic files code (and retesting them with the nRF52832DK) and I realize that the code in &lt;code&gt;boards.c&lt;/code&gt; also has this &amp;quot;problem&amp;quot; in mind (I do not know if it is finally a problem).&lt;/p&gt;
&lt;p&gt;I mean: In the function &lt;code&gt;bsp_board_led_on&lt;/code&gt;, where the led should light up, the &lt;code&gt;nrf_gpio_pin_write&lt;/code&gt; function is called with 0 as parameter and, in this write function, if 0 is the parameter, then &lt;code&gt;nrf_gpio_pin_clear&lt;/code&gt; function is called (if not, then the &lt;code&gt;nrf_gpio_pin_set&lt;/code&gt; is called`).&lt;/p&gt;
&lt;p&gt;In summary, &lt;code&gt;bsp_board_led_on&lt;/code&gt; uses &lt;code&gt;nrf_gpio_pin_clear&lt;/code&gt; to light up the leds and &lt;code&gt;bsp_board_led_off&lt;/code&gt; uses &lt;code&gt;nrf_gpio_pin_set&lt;/code&gt; to turn off the leds.&lt;/p&gt;
&lt;p&gt;What does the variable &lt;code&gt;LEDS_ACTIVE_STATE&lt;/code&gt; mean with value 0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pins don't work as expected.</title><link>https://devzone.nordicsemi.com/thread/119077?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 21:50:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740d463e-fd5d-4452-a905-d2fb0cb31e02</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;Based on your information, I am assuming you bought the board from some company and did not design it yourself.&lt;/p&gt;
&lt;p&gt;The most likely reason the LED activity is backward is that LED&amp;#39;s are commonly sinked and not sourced via the IC. The reason for this is that there is a limit to how much current one can have the IC (nRF SoC) source but generally it can sink to ground much more. Thus power for the LED&amp;#39;s comes from a separate connection to Vdd and the cathode of LED is connected to gpio.&lt;/p&gt;
&lt;p&gt;So, a clear turns it on and a set turns it off.&lt;/p&gt;
&lt;p&gt;You should probably start first by securing a schematic to the nRF based board. It will probably illustrate the reasons for your other gpio issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>