Gpio push-pull output and open-drain output detailed

Source: Internet
Author: User

Open-drain and Push-pull "
The function of Gpio is simply that it can be configured as input or output according to its own needs. However, when configuring the Gpio pins, two modes are often seen: open-drain (open-drain, open-drain) and push-pull (push-pull).
What are the differences between the two modes, and the following collated some information to explain in detail:


Chart 1 push-pull contrast Open-drain

Push-pull Push-Pull output Open-drain Open-Drain output
Principle The output device is a pair of complementary mosfets integrated into the output pin, which outputs high when the Q1 on, Q2 Cutoff, and low when the Q1 is on, Q2 on. 25pt;border:solid #E3EDF5 1.0pt;mso-border-alt: Solid #E3EDF5.75pt;padding:3.0pt 3.0pt 3.0pt 3.0pt ' >

The output device is a pair of complementary mosfets integrated into the output pin, which outputs high when the Q1 is on, Q2 Cutoff, and when the Q1 is on, Q2 on, and the output level is low.

The open-drain circuit refers to a circuit with a very high output of the MOSFET leakage. A MOSFET (Q1) with an n-channel between the internal output and the ground, which can be used for level shifting applications. The output voltage is determined by VCC '. VCC ' can be greater than the input high level voltage VCC (up-translate) or can be lower than the input high voltage VCC (down-translate).
A more thorough explanation of a foreigner push-pull output, which is actually internally using two transistors (transistor), called top transistor and bottom here, respectively Transistor. The corresponding level is output by the transistor corresponding to the switch. Top transistor open (bottom transistor off), output is high, bottom transistor on (top transistor off), output low. The push-pull is capable of leakage currents (sink current) and the ability to set current (source currents). It may have, perhaps, no other state: high-impedance (high impedance) state. Additional pull-up resistors are not required unless the push-pull needs to support additional high impedance states. open-drain Output, there is less than push-pull a top transistor, only the bottom transistor. (as in push-pull) when the bottom transistor is off, the output is high. There is no way to output a high level, you want to output a high level, must be externally connected with a pull-up resistor (pull-up resistor). The Open-drain is only capable of leakage currents (sink current), and a pull-up resistor is required if you want to set the current. Out low level

 

  common Gpio mode can be configured as Open-drain or Push-pull, specifically implemented, It is often configured to Open-drain or push-pull by configuring some bits of the corresponding register. When we go through the CPU to set a bit (bit) of those gpio configuration registers, the internal implementation of its GPIO hardware IC is to open or close the corresponding top transistor. Correspondingly, if set in order to open-d mode, it is necessary to pull up the resistor to achieve, also can output high level. Therefore, if the internal hardware (internal) itself contains the corresponding pull-up resistor, then the corresponding pull-up resistor will be closed or opened. If there is no corresponding pull-up resistor inside the GPIO hardware IC, then you must provide the corresponding external (external) pull-up resistor in your hardware circuit. The advantage of the push-pull output is that it is fast because the line is driven in two ways. And the line with the pull-up resistor, even if the fastest speed to raise the voltage, the fastest also need a constant rxc time. where r is the resistor, C is the parasitic capacitance (parasitic capacitance), which includes the pin Pin's capacitance and the board's capacitance. However, the relative disadvantage of push-pull is that it often consumes more current, that is, the power consumption is relatively large. The open-drain consumes a relatively small current, limited by the Resistance R, and R cannot be too small, because when the output is low, it needs to sink lower transistor, which means higher power dissipation. (This paragraph was originally: because the lower transistor have to sink, that's when the output was low; That means higher power consumption.) and one of the benefits of Open-drain is that you are allowed to CShort (? ) Multiple open-drain circuits, common with a pull-up resistor, which is known as a wired-or connection, can be lowered by pulling down the pin pin of any IO to make the output low. To output a high level, all outputs are high. This logic, which is the "line and" function, does not require additional gate circuitry to implement this part of the logic.
schematic  

 

Chart  2 push-pull schematic diagram must be externally connected with a pull-up resistor (pull-up resistor). The Open-drain is only capable of leakage currents (sink current), and a pull-up resistor is required if you want to set the current. Out low level

 

Chart  3 open-drain schematic diagram?? The outside is then connected with a pull-up resistor (pull-up resistor). The Open-drain is only capable of leakage currents (sink current), and a pull-up resistor is required if you want to set the current. Out low level

 

  Chart  4 Open-drain "line and" function? Need to add a pull-up resistor. Out low level

 

 

Advantages (1) Can sink current, can also be through the current, (2) and open-drain output compared to the high and low level of the IC push-pull, not simple logic operation.

(1)
Very useful for level shifting between various voltage nodes, can be used for up-translate and down-translate conversions of various voltage nodes
(2) can be a plurality of open-drain pin pin, connected to a line, forming a "and logic" relationship, that is, "line and" function, any one lower, open the line logic is 0. This is also the principle of I2c,smbus bus to determine the state of bus occupancy. (3) The drive capability of external circuit is used to reduce the internal drive of IC. When the IC internal MOSFET is on, the drive current is from the external VCC through R pull-up, MOSFET to GND. Only a very lower gate drive current is required inside the IC. (4) can change the voltage of the pull-up power supply, change the transmission level: 5 Open-drain Output Level principle lang=en-us>r cannot be too small, because when the output is low, you need to sink lower transistor, which means higher power consumption. (This paragraph is originally: because the lowertransistor have to sink, the output is low; That means higherpower consumption.) and one of the benefits of Open-drain is that you are allowed to CShort (? ) Multiple open-drain circuits, common with a pull-up resistor, which is known as a wired-or connection, can be lowered by pulling down the pin pin of any IO to make the output low. To output a high level, all outputs are high. This logic, which is the "line and" function, does not require additional gate circuitry to implement this part of the logic.

The logic level of the IC is determined by the power Vcc1, while the output high level is determined by the VCC2. This allows us to control the output of high logic with low level logic.

Disadvantages   A bus can only have one push-pull output device;: "Times New Roman"; color: #444444; mso-ansi-language:en-us; mso-fareast-language : The logic level of ZH-CN;MSO-BIDI-LANGUAGE:AR-SA ' > is determined by the power Vcc1, while the output high level is determined by the VCC2. This allows us to control the output of high logic with low level logic. The   open-drain pin does not connect the external pull-up resistor, only the low level is output. When the output level is low, the N-channel transistor is on, so that a continuous current flows between VCC ' and gnd through the pull-up resistor R and transistor Q1. This can affect the power consumption of the entire system. A pull-up resistor with a larger value can reduce the current. However, a large resistance will slow the rise time of the output signal. That is, the resistance of the pull-up resistor R pull-up determines the speed of the logic level translation along the
. The greater the resistance, the lower the power consumption. Vice versa. ine-height:115%;font-family: "Verdana", "Sans-serif", mso-fareast-font-family: "Times New Roman"; Mso-bidi-font-family: "Times New Roman"; color: #444444; mso-ansi-language:en-us;mso-fareast-language:zh-cn; Mso-bidi-language:ar-sa ' > ' line and ' function, the logic on the open-drain line is 0 when any one becomes low. This is also the principle of I2c,smbus bus to determine the state of bus occupancy. (3) The drive capability of external circuit is used to reduce the internal drive of IC. When the IC internal MOSFET is on, the drive current is from the external VCC through R pull-up, MOSFET to GND. Only a very lower gate drive current is required inside the IC. (4) can change the voltage of the pull-up power supply, change the transmission level: chart  5 Open-drain output level principle lang=en-us>r not too small, because when the output is low, you need to sink lower transistor, This means higher power consumption. (This paragraph is originally: because the lowertransistor have to sink, the output is low; That means higherpower consumption.) and one of the benefits of Open-drain is that you are allowed to CShort (? ) Multiple open-drain circuits, common with a pull-up resistor, which is known as a wired-or connection, can be lowered by pulling down the pin pin of any IO to make the output low. To output a high level, all outputs are high. This logic, which is the "line and" function, does not require additional gate circuitry to implement this part of the logic.
Characteristics In the CMOS circuit should be called CMOS output is more appropriate, because in the CMOS push-pull output capacity can not do the double pole so large. The output capability looks at the area of the IC's internal output pole N tube p tube. The Push-pull is now the most used output stage design in CMOS circuits.

"Summary of Open-drain and Push-pull"
The setting for Gpio mode, regardless of whether additional pull-up resistors are required, is set to Open-drain or Push-pull, in the final analysis, a tradeoff issue:
If you want the level conversion speed, then choose Push-pull, but the disadvantage is that the power consumption is relatively larger.
If you want low power consumption and have "line and" functions at the same time, then use Open-drain mode. (Also note that there is a pull-up resistor inside the GPIO hardware module, and if not, a hardware circuit is required

Add extra pull-up resistor)
It is so-called, the conversion speed and power consumption, is the fish and Bear paw, two can not be combined with Yan. Ze:9.0pt;line-height:115%;font-family: "Microsoft Jas Black", "Sans-serif", mso-bidi-font-family: "Times New Roman"; color: #444444; Mso-ansi-language:en-us;mso-fareast-language:zh-cn;mso-bidi-language:ar-sa ' > function, the logic on the open-drain line is 0 when any one becomes low. This is also the principle of I2c,smbus bus to determine the state of bus occupancy. (3) The drive capability of external circuit is used to reduce the internal drive of IC. When the IC internal MOSFET is on, the drive current is from the external VCC through R pull-up, MOSFET to GND. Only a very lower gate drive current is required inside the IC. (4) can change the voltage of the pull-up power supply, change the transmission level: 5 Open-drain Output Level principle lang=en-us>r cannot be too small, because when the output is low, you need to sink lower transistor, which means higher power consumption. (This paragraph is originally: because the lowertransistor have to sink, the output is low; That means higherpower consumption.) and one of the benefits of Open-drain is that you are allowed to CShort (? ) Multiple open-drain circuits, common with a pull-up resistor, which is known as a wired-or connection, can be lowered by pulling down the pin pin of any IO to make the output low. To output a high level, all outputs are high. This logic, which is the "line and" function, does not require additional gate circuitry to implement this part of the logic.

Gpio push-pull output and open-drain output detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.