Difference between Open Drain and Push Pull

Submitted by Sangharsh on Thu, 08/30/2018 - 18:32

I was reading the datasheet of ARM Cortex Chip, mainly that GPIO chapter, as i want to configure various GPIO pins to use them in "Alternate Function" mode for read/write access to SRAM.

for all the registers available for GPIO is didn't understand output type registers, as there are two choices for output type registers:

  • Open-drain
  • Push-Pull 

so my question is what is the difference between these two?

Thanks in advance.....

When you configure the GPIO pin of a microcontroller as Output. The Output pin can either be as Open-Drain type or  Push-Pull Type. Both these configurations tell us how the GPIO pin of uC is designed internally.

Open-Drain Type: In open drain type there will be only one switch (transistor/MOSFET) inside the uC and this switch is connected to Ground. 

Push-Pull Type: In Push-Pull type there will be two switches (transistor/MOSFET) inside the uC and one switch will be connected to Ground and the other will be connected to Vcc/Vdd. 

Both Open-Drain and Push-Pull Mode is illustrated in the below picture. In most cases the push-pull type will be more advantageous than Open Drain Type. And modern MCUs have Push-Pull type 

05outputs.png

  Joined August 16, 2016      997
Tuesday at 12:29 AM

In Open Drain Type:

If you make the output pin HIGH the pin will be connected to ground through the switch and if you make the Output pin LOW the pin will be left floating since the switch will be turned off.

In Push-Pull Type:

If you make the output HIGH the pin will be connected to Vdd through the NPN switch and if you make the Output pin LOW the pin will be connected to Ground thorough the PNP switch. 

Since in the Open Drain type the pin is left as floating a pull-high or pull-down resistor is usually added to the GPIO pin. But in morden day MCUs most of the GPIO output pins are Push-Pull type 

  Joined September 07, 2017      256
Thursday at 12:15 PM

​Aisha,

Your answer explaining the push and pull phase was incorrect. I think it might create confusion for the readers. The correct working of push pull phase is as follows:

  • Push phase – When the Internal Signal connected to the gates of the transistors (see the figure above) is set to a low logic level (logic 0), the PMOS transistor is activated and current flows through it from the VDD to the output pin. NMOS transistor is inactive (open) and not conducting.
  • Pull phase – When the Internal Signal connected to the gates of the transistors is set to a high logic level (logic 1), the NMOS transistor is activated (closed) and current starts to flow through it from the output pin to the GND. At the same time, the PMOS transistor is inactive (open) and is not conducting current.

  Joined January 13, 2021      1
Wednesday at 01:38 PM

Unlike push-pull, an open-drain output can only sink current. In order to achieve a logical high output on the line, a pull-up resistor is used to connect the open-drain output to the desired output voltage level.

  Joined February 27, 2020      55
Thursday at 11:08 AM