<?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>Reading High impedance via GPIO pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51676/reading-high-impedance-via-gpio-pin</link><description>Dear sir, 
 
 We have interfaced a charger ic with NRF52832. It is having a charging status pin to show completion of charge. It is having 3 states 
 1. High impedance (Battery not present or module shut down) 
 2. Low (Charging) 
 3. High (Charge complete</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Sep 2019 19:56:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51676/reading-high-impedance-via-gpio-pin" /><item><title>RE: Reading High impedance via GPIO pin</title><link>https://devzone.nordicsemi.com/thread/207499?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 19:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b934f504-06dd-4cd2-9c09-af2870708f6b</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Yes it is possible to infer high-impedance state. With MCP73831 a high-resistance voltage divider is required to keep the input voltage within acceptable range (as mentioned by Dmitry). With the input pin connected to the divider mid-point read the port pin twice, once with PULLDOWN enabled and once with PULLUP enabled on the port pin. If the MCP73831 is driving low, both reads will return &amp;#39;0&amp;#39;. If the MCP73831 is driving high both reads will return &amp;#39;1&amp;#39;. If the&amp;nbsp;&lt;span&gt;MCP73831 is High Z the first read will be &amp;#39;0&amp;#39; and the second &amp;#39;1&amp;#39;. Allow time for any distributed capacitance to charge/discharge, perhaps a few uSecs after changing the pull-down/pull-up before reading the pin..&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edit: note the resistance divider has to be low enough to prevent the 13k internal pull-up or pull-down from holding above or below the 0/1 input thresholds when the charger drives L or H; 2 x about 2k would work but that sacrifices over 1 mA through the divider.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading High impedance via GPIO pin</title><link>https://devzone.nordicsemi.com/thread/207495?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 19:07:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73e856b-9ab2-49d1-8cbd-93caebf295d0</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;MCP73831 has high output level of STAT signal close to its supply voltage (charging voltage). GPIO pins of nrf52832 are limited by VDD+0.3V. Don&amp;#39;t connect STAT pin of 73831 to GPIO directly - either use 73832 with pull-up, or add a voltage divider.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading High impedance via GPIO pin</title><link>https://devzone.nordicsemi.com/thread/207489?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 18:31:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f488c324-20cf-4ffb-b1e5-3a09faf01c4a</guid><dc:creator>awneil</dc:creator><description>[quote userid="6462" url="~/f/nordic-q-a/51676/reading-high-impedance-via-gpio-pin/207488"]Presumably, this pin is intended to drive the midpoint of a pair of series-connected LEDs[/quote]
&lt;p&gt;Indeed that&amp;#39;s what the datasheet says:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1567449050546v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading High impedance via GPIO pin</title><link>https://devzone.nordicsemi.com/thread/207488?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 18:22:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:008484a3-3476-42f3-ad72-ed9e3e73436f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;strong&gt;No:&lt;/strong&gt; In input mode, GPIO is a &lt;em&gt;&lt;strong&gt;digital&lt;/strong&gt; &lt;/em&gt;input,&amp;nbsp; so it can only read &amp;#39;high&amp;#39; or &amp;#39;low&amp;#39; = &amp;#39;1&amp;#39; or &amp;#39;0&amp;#39;.&lt;/p&gt;
&lt;p&gt;To read a 3rd state, you&amp;#39;d need to do something analogue.&lt;/p&gt;
&lt;p&gt;The same would apply to &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;microcontroller - it&amp;#39;s not specific to Nordic or nRF52.&lt;/p&gt;
&lt;p&gt;Presumably, this pin is intended to drive the midpoint of a pair of series-connected LEDs&amp;nbsp; so that either one or the other will be on - or neither in the Hi-Z state?&lt;/p&gt;
&lt;p&gt;You should contact the chip manufacturer to see if they have any recommendations for connecting this to a microcontroller ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>