Difference between Open Drain and Push Pull

Sangharsh's picture

Offline

Joined: Aug 30, 2018

Replies: 0
Difference between Open Drain and Push Pull
August 30, 2018 - 6:32pm

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.....

Aswinth Raj's picture

Offline

Joined: Aug 16, 2016

Replies: 940
GPIO Output mode Open Drain and Push Pull
August 30, 2018 - 7:37pm

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

AISHA's picture

Offline

Joined: Sep 07, 2017

Replies: 254
Open Drain Vs Push Pull
August 30, 2018 - 7:46pm

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