<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Tristatelogic-vs-opendrain</id>
	<title>Tristatelogic-vs-opendrain - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Tristatelogic-vs-opendrain"/>
	<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Tristatelogic-vs-opendrain&amp;action=history"/>
	<updated>2026-05-17T04:22:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://www.marcelpost.com/wiki/index.php?title=Tristatelogic-vs-opendrain&amp;diff=2626&amp;oldid=prev</id>
		<title>Admin at 10:43, 29 December 2016</title>
		<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Tristatelogic-vs-opendrain&amp;diff=2626&amp;oldid=prev"/>
		<updated>2016-12-29T10:43:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The datasheet for the MCP73831/2 LiPo charge controllers shows that the chip can be ordered with the STATUS pin preconfigured as either Tri-State Logic or Open-Drain.&lt;br /&gt;
&lt;br /&gt;
So what is the difference and why would you want one over the other?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===MCP73832 (Open Drain)===&lt;br /&gt;
&lt;br /&gt;
Consider the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Open-drain-output.jpg]]&lt;br /&gt;
&lt;br /&gt;
The dotted box is the charge controller and the (N-Channel) FET controls the STAT pin going to the outside world. As you can see the Drain pin of the FET is not connected to VCC. Therefore, the FET can only be in one of two states; when the Gate is ON, the Drain is pulled to Ground, when the Gate is OFF, the Drain is floating. The floating state becomes useful when we use an external pull-up resistor. This way when the Gate is OFF, the Drain is pulled up by the resistor to VCC.&lt;br /&gt;
&lt;br /&gt;
If we want to add an LED to show the charge status with the open drain charge controller we need to have a look at the available signals for the MCP73832 from the datasheet:&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
Table 5-1  summarizes  the  state  of  the  status  output&lt;br /&gt;
&lt;br /&gt;
during a charge cycle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MCP73832 status-pin.jpg]]&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
As you can see the available signals are only:&lt;br /&gt;
&lt;br /&gt;
* High impedance (High-Z) when the Gate is OFF (and Drain is floating)&lt;br /&gt;
&lt;br /&gt;
* Low impedance (Low-Z) when the Gate is ON (and Drain is actively pulled to Ground)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we were to place an LED to Ground in series with R1 like so:&lt;br /&gt;
&lt;br /&gt;
[[File:Open-drain-output-with-external-pullup-and-led.jpg|thumb|none|300px|Led through External Pull-up Resistor]]&lt;br /&gt;
&lt;br /&gt;
..the LED would turn on when the Gate is ON (Closing the path from Drain to Ground) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this configuration, and according to the datasheet, the LED would turn on:&lt;br /&gt;
&lt;br /&gt;
* When the Charge Controller is in battery pre-conditioning mode&lt;br /&gt;
&lt;br /&gt;
* Charging the battery in constant-current mode&lt;br /&gt;
&lt;br /&gt;
* topping up the battery in constant-voltage mode&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the battery is full, the &amp;#039;Charge Complete&amp;#039; status turns the Gate OFF and the path to Ground as seen from the Drain is disconnected and the LED Cathode is floating at VCC, which effectively turns the LED off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A little more on the pull-up resistor when we&amp;#039;re talking about microcontrollers. Most microcontrollers have an internal Pull-up Resistor and can source (some) current to power external circuitry like a LED. The schematic will then look something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Open-drain-output-with-internal-pullup-and-led.jpg|thumb|none|300px|Internal Pull-up Resistor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===MCP73831 (Tri-State Logic)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s have a look at the tri-state function of the STAT pin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MCP73831 status-pin.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3  Charge Status Output (STAT)&lt;br /&gt;
&lt;br /&gt;
STAT is an output for connection to an LED for charge&lt;br /&gt;
&lt;br /&gt;
status indication. Alternatively, a pull-up resistor can be&lt;br /&gt;
&lt;br /&gt;
applied for interfacing to a host microcontroller.&lt;br /&gt;
&lt;br /&gt;
STAT is a tri-state logic output on the MCP73831 and&lt;br /&gt;
&lt;br /&gt;
an open-drain output on the MCP73832.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The charge charge status output can be used to illuminate 1, 2, or tri-color LEDs. Optionally, the charge status output can be used as an interface to a host microcontroller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.2.1 STATUS INDICATOR (STAT)&lt;br /&gt;
&lt;br /&gt;
The charge status output of the MCP73831 has three&lt;br /&gt;
&lt;br /&gt;
different   states:   High   (H),   Low   (L),   and   High-&lt;br /&gt;
&lt;br /&gt;
Impedance  (High  Z).  The  charge  status  output  of  the&lt;br /&gt;
&lt;br /&gt;
MCP73832  is  open-drain.  It  has  two  different  states:&lt;br /&gt;
&lt;br /&gt;
Low (L) and High-Impedance (High Z). The charge sta-&lt;br /&gt;
&lt;br /&gt;
tus output can be used to illuminate one, two or tri-color&lt;br /&gt;
&lt;br /&gt;
LEDs. Optionally, the charge status output can be used&lt;br /&gt;
&lt;br /&gt;
as an interface to a host microcontroller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{MsgBox&lt;br /&gt;
| type = tip&lt;br /&gt;
| description = No proper images yet for the tri-state and open drain logic yet&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is what Tri-State logic looks like:&lt;br /&gt;
&lt;br /&gt;
[[File:MCP73831-tri-state.jpg|thumb|none|250px|Tri-State]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And this is an Open Drain configuration:&lt;br /&gt;
&lt;br /&gt;
[[File:MCP73832-open-drain.jpg|thumb|none|250px|Open Drain]]&lt;br /&gt;
&lt;br /&gt;
Open Drain has two states, High-Z (high resistance) and Low-Z (low resistance).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use a common anode tricolour LED (two LED&amp;#039;s with their anodes connected, not bicolour):&lt;br /&gt;
&lt;br /&gt;
* Anode was connected to the input power supply&lt;br /&gt;
* Green cathode connected to ground with a current limiting resistor.&lt;br /&gt;
* Red cathode to the STAT pin.  &lt;br /&gt;
&lt;br /&gt;
No chip power supply: LED off&lt;br /&gt;
&lt;br /&gt;
Charging - yellow&lt;br /&gt;
&lt;br /&gt;
Done - Green (But it will also light up green when no battery is present)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You could implement a &amp;#039;red - charging, green - done&amp;#039; with same LED, but with an extra NPN transistor on the green cathode.  So when the STAT is low, transistor is off, but pulls the red cathode low.  When STAT is high, transistor on, green LED on, red off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sources: &lt;br /&gt;
&lt;br /&gt;
* http://ww1.microchip.com/downloads/en/DeviceDoc/20001984g.pdf&lt;br /&gt;
&lt;br /&gt;
* http://ww1.microchip.com/downloads/en/DeviceDoc/51596a.pdf&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>