What does open-drain & push-pull mean?

Background: These concepts are important for microcontrollers, specifically general purpose input/output (GPIO) pins.

The terms sound quite convoluted, but are much simpler than you think when you apply it in real-world examples! :electric_plug:

Think of a microcontroller with pins, physical points on the integrated circuit (IC) that allow for connections with external devices. Behind each pin, there is circuitry (pads) that can be configured to interface with different analog/digital circuits (sensors, additional IC’s, etc.)

The pins are often high impedance, meaning it’s not actively driven and is “floating” until another device/circuitry drives it to a certain voltage level. A pin is floating if it’s unconnected ad not driven internally by the IC.

Open-drain & push-pull are common output configurations to define a discrete level for floating pins.

If left as is without using output configurations, its voltage level is undefined and unpredictable.

  1. Open Drain configurations drives the logic behind the pin to ground (logic 0). The other possible state is when it is at high impedance. Typically, this implementation is done using a single transistor.
    Open Drain Output

  2. Push-pull configuration is capable of driving two output levels. One is to pull to ground (sink current from load), and the other is to push to the power supply voltage (source current to the load). This implementation is commonly done using a pair of switches, like transistors.
    Push-Pull Output

Advantages & Disadvantages (Open4Tech):

  • Push-pull output is best suited for communication interfaces that have single direction lines (e.g SPI, UART etc.). Open drain is commonly used for bidirectional single line communication interfaces, where more than two devices are connected on the same line(e.g I2C, One-Wire etc.)
  • Open drain output has higher power consumption during active transfers due to the pull-up resistors that are used.
  • In general, the push-pull output has faster slopes than the open drain output.

References: