<?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>nrf_gpio_cfg() function leaks current to pins</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24242/nrf_gpio_cfg-function-leaks-current-to-pins</link><description>When I run an infinite loop of NOP on the NRF52DK, the led&amp;#39;s remain dark. But when I run an infinite loop of: 
 nrf_gpio_cfg(
pin,
NRF_GPIO_PIN_DIR_INPUT,
NRF_GPIO_PIN_INPUT_DISCONNECT,
NRF_GPIO_PIN_PULLDOWN,	// !!! pulldown
NRF_GPIO_PIN_H0H1,	</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Aug 2017 22:07:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24242/nrf_gpio_cfg-function-leaks-current-to-pins" /><item><title>RE: nrf_gpio_cfg() function leaks current to pins</title><link>https://devzone.nordicsemi.com/thread/95440?ContentTypeID=1</link><pubDate>Thu, 10 Aug 2017 22:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:758e3844-e77c-4136-8b27-0c153394daa8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;if you set it as an output you&amp;#39;re actually driving it, it&amp;#39;s a push-pull circuit (totem-pole?) so if the thing you&amp;#39;re connected to doesn&amp;#39;t have a lot of resistance you could be pulling a current through it. The pull is passive, just connects a virtual resistor (10k? ish) between the pin and VDD or VCC, so that won&amp;#39;t ever draw that much current and just anchors the pin.&lt;/p&gt;
&lt;p&gt;Imagine you connect, say, to a reset pin on a chip on your board. You don&amp;#39;t want it to float when you&amp;#39;re not using it, you don&amp;#39;t want to drive it, you don&amp;#39;t need to read it, so you just set it as input, turn off the buffer and pull it high. At the point you need to actually use it, then you configure it as output and drive it where you want.&lt;/p&gt;
&lt;p&gt;So consider input + pull + disconnect as a &amp;#39;passive&amp;#39;, guaranteed low power way to stop a pin floating.&lt;/p&gt;
&lt;p&gt;The diagram could be more clear here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_cfg() function leaks current to pins</title><link>https://devzone.nordicsemi.com/thread/95439?ContentTypeID=1</link><pubDate>Thu, 10 Aug 2017 21:59:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a312272b-f200-40e8-87fc-983502c899e8</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;Thanks.  Finally an answer that explains missing parts of the diagram.  Why would you need to pull a pin that you don&amp;#39;t read?  My reasoning: if you don&amp;#39;t read it implies not an input implies is output, and the output circuitry will drive it low or high.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_cfg() function leaks current to pins</title><link>https://devzone.nordicsemi.com/thread/95438?ContentTypeID=1</link><pubDate>Thu, 10 Aug 2017 21:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f998b5e-cfa7-4a81-b570-1155b1fcd0ec</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You&amp;#39;re explicitly attaching a pulldown to the pin. The reset state of the pins is NOPULL. Looking at the GPIO diagram, pull is attached after direction (input disconnect isn&amp;#39;t shown explicitly on the input buffer but the intention of that is to disconnect the read circuit, not to prevent pull, you often need to pull a pin you don&amp;#39;t need to read).&lt;/p&gt;
&lt;p&gt;So you are explicitly pulling all your pins low so I&amp;#39;d expect them all to glow.&lt;/p&gt;
&lt;p&gt;Change it to NOPULL to hi-Z them and the LEDs won&amp;#39;t glow. That is the actual reset state. I believe Hung Bui suggested this in the last thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>