Skip to content

Push-Pull and Open-Drain Outputs

In general, microcontroller pins have a driving circuit that can be configured for different types of digital and analog circuit interfaces. The output mode generally includes push-pull and open-drain outputs.

Push-Pull Output

Push-pull output can output two levels, one is push (current sourcing, high level output), and the other is pull (current sinking, low level output). Push-pull output can be implemented using a pair of switches, usually using transistors or field-effect transistors (FETs) in the chip.

As shown in the figure, it shows the push and pull processes:

  • Push: When the input signal is low, the P-MOS is turned on, and the current flows from VDD through it to the output pin. At this time, the N-MOS is off.
  • Pull: When the input signal is high, the N-MOS is turned on, and the current flows from the output pin through it to GND. At this time, the P-MOS is off.

Push-pull operation does not allow multiple devices to be connected together in a bus configuration. It can only be used for interfaces with unidirectional lines (such as SPI, UART). If two push-pull output structures are connected together and one outputs a high level (i.e., the upper transistor is on and the lower transistor is off), while the other outputs a low level (i.e., the upper transistor is off and the lower transistor is on), the current will flow directly from the VCC of the first pin through the upper transistor to the lower transistor of the second pin and then to GND. The entire path has a very low resistance, which can cause a short circuit and may damage the port. This is also the reason why push-pull output cannot achieve wired-AND.

Push-pull output has higher driving capability because it can drive high and low levels, and it has better rise/fall edges (larger slope) in digital signals, which means better performance.

Push-pull output can also be configured as an input mode by turning off the upper and lower transistors, making it in a high-impedance state on the line.

Open-Drain Output

Open-drain (OD) refers to opening the drain of the MOS transistor. In history, there was also open-collector output (OC).

The most primitive open-drain output has only two states: low and high impedance. If a high level needs to be output, an external pull-up resistor is required.

The most primitive open-drain output is implemented using an N-MOS transistor. When the input signal is high, the output pin is pulled low to ground; but when the input signal is low, the output pin is in a high-impedance floating state.

The main characteristic of open-drain output is that it has no driving capability for high level, and it needs an external pull-up resistor to truly output a high level.

Open-drain output is commonly used in communication interfaces where multiple devices are connected on the same line (such as I2C, One-Wire). The line is normally pulled up to a high level by a pull-up resistor, and when any device triggers a signal, the entire line is pulled low.

The pull-up resistor used for open-drain output must balance the following parameters:

  • Edge slope: The line itself has capacitance, and coupling between the pull-up resistor and the capacitance forms a low-pass filter, and different resistor values will affect the rise/fall edges. The smaller the resistor value, the steeper the edge, and the better the signal transmission effect.
  • Power consumption: If the pull-up resistor value is too small, it will cause excessive power consumption when the line is pulled up.
  • Noise: If the pull-up resistor value is too large, the pull-up will become weaker, and external interference noise will be more easily picked up by the line.

Comparison

Push-Pull Output Open-Drain Output
High-level driving capability High Depends on external pull-up resistor
Low-level driving capability High High
Level transition speed Fast Determined by external pull-up resistor, smaller resistor value means faster transition but higher power consumption
Wired-AND Not supported Supported
Level conversion Not supported Supported
  • Push-pull output is generally used for unidirectional line communication; open-drain output is usually used for bidirectional line communication.
  • Due to the presence of pull-up resistors, open-drain output has relatively higher power consumption.
  • In general, push-pull switching speed is faster than open-drain.

References and Acknowledgements

Original: https://wiki-power.com/ This post is protected by CC BY-NC-SA 4.0 agreement, should be reproduced with attribution.

This post is translated using ChatGPT, please feedback if any omissions.