Our Latest News

The difference between push-pull output and open-drain output of microcontroller I/O port

Push-pull output: can output high and low level, connected to digital devices;

Open-drain output: The output is equivalent to the collector of a triode. To get a high level state requires a pull-up resistor to work. Suitable for doing current-type drive, its ability to absorb current is relatively strong (generally within 20ma).

Push-pull structure generally refers to the two transistors are subject to the control of two complementary signals, always in a transistor on when the other cut off.

This image has an empty alt attribute; its file name is image-415.png

Let’s talk about the structure of the open collector output. Open collector output structure as shown in Figure 1, the right side of the transistor collector is not connected to anything, so it is called open collector (the left side of the transistor for inversion, so that when the input is “0”, the output is also “0”). For Figure 1, when the left end of the input for “0”, the front of the transistor cut off (i.e., between the collector C and the emitter E is equivalent to disconnect), so the 5V power supply through the 1K resistor to the right transistor, the right transistor on (i.e., equivalent to a switch closed); when the left end of the input for “1”, the front of the transistor conducts, while the back of the transistor cut off (equivalent to a switch off).

db6f4ae2-67d6-11ed-8abf-dac502259ad0.jpg

We have simplified Figure 1 to look like Figure 2. The switch in Figure 2 is controlled by software and is open when “1” and closed when “0”. It is clear that when the switch is closed, the output is directly grounded, so the output level is 0. When the switch is open, the output is suspended, i.e., the high resistance state. At this point the level state is unknown, and if a resistive load (even a very light load) goes to ground behind it, then the level at the output is pulled low by this load, so this circuit is not able to output a high level.

Look at Figure 3 again. The 1K resistor in Figure 3 is the pull-up resistor. If the switch is closed, there is current flowing from the 1K resistor and the switch, but because the open and close the other three ports with internal pull-up), when we want to use the input function, just set the output port to 1, which is equivalent to that switch off, and for the P0 port, it is a high resistance state.

For the open drain (OD) output, it is very similar to the open collector output. The above triode can be replaced with a field effect tube. This collector becomes the drain, OC becomes OD, the principle analysis is the same.

Another output structure is the push-pull output. The structure of the push-pull output is to replace the upper pull-up resistor with a switch, when the output is high, the upper switch on, the lower switch off; and to output a low level, it is just the opposite. Compared with OC or OD, this push-pull structure has a strong high and low level driving capability. If two outputs with different levels are connected together, a large current will be generated and the output port may be burned out. The above mentioned OC or OD output will not have such a situation, because the pull-up resistor provides a relatively small current. If the push-pull output is to be set to a high resistance state, then both switches must be disconnected at the same time (or use a transmission gate on the output port) so that it can be used as an input state, and some IO ports of AVR microcontrollers are of this structure.

Open-drain circuit characteristics and applications

In circuit design, we often encounter the concepts of open drain and open collector.

The so-called open drain circuit concept mentioned in the “drain” is the drain of the MOSFET. Similarly, the “set” in the open collector circuit refers to the collector of the triode. Open-drain circuit is the circuit with the drain of the MOSFET output. The common usage is to add a pull-up resistor to the circuit outside the drain. A complete open-drain circuit should consist of an open-drain device and an open-drain pull-up resistor. As shown in Figure 1.

db8b0692-67d6-11ed-8abf-dac502259ad0.jpg

Figure 1

The circuit composed of open-drain form has the following characteristics.

  1. use the drive capability of the external circuit to reduce the IC internal drive (or drive a load higher than the chip supply voltage). When the MOSFET inside the IC is on, the drive current flows from the external VCC through R pull-up , MOSFET to GND. only a very low gate drive current is required inside the IC. As shown in Figure 1. 2.
  2. Multiple open-drain output pins can be connected to a single line. Form a “with logic” relationship. As in Figure 1, when any of PIN_A, PIN_B, PIN_C becomes low, the logic on the open-drain line will be 0. This is also the principle of I2C, SMBus and other buses to determine the bus occupancy status. If the output must be connected as a pull-up resistor. When the capacitive load is connected, the down delay is the transistor inside the chip, is active drive, faster; up delay is a passive external resistor, slow speed. If the requirement for high speed resistance selection to small, power consumption will be large. So the choice of load resistance to take into account the power consumption and speed.
  3. can be used to change the voltage of the pull-up power supply to change the transmission level. As in Figure 2, the logic level of the IC is determined by the power supply Vcc1, while the output high level is determined by Vcc2 (the supply voltage of the pull-up resistor). This way we can control the output high level logic with low level logic (so you can do any level conversion). (For example, adding pull-up resistors will provide TTL/CMOS level output, etc.)
dba1bb62-67d6-11ed-8abf-dac502259ad0.jpg

Figure 2

  1. If the open-drain Pin is not connected to an external pull-up resistor, it can only output a low level (so for the P0 port of a classic 51 microcontroller, an external pull-up resistor must be added to do the input and output functions, otherwise it cannot output high level logic). Generally speaking, open-drain is used to connect devices with different levels and match levels.
  2. The standard open-drain pin generally only has the ability to output. Add other judgment circuits to have bidirectional input and output capability.
  3. The normal CMOS output stage is the upper and lower two tubes, remove the upper tube is OPEN-DRAIN. The main purpose of this output has two: level conversion, line and.
  4. The line with function is mainly used when there are multiple circuits for pull-down operation of the same signal. If this circuit does not want to pull-down, it outputs high level because the tube above OPEN-DRAIN is taken off and the high level is achieved by an external pull-up resistor. (And the normal CMOS output stage, if there is an output for high another for low, equal to a short circuit in the power supply.)
  5. OPEN-DRAIN provides a flexible output method, but also has its weakness, is to bring the rising edge of the delay. Because the rising edge is charged to the load through an external pull-up passive resistor, so when the resistance is selected when the delay is small, but the power consumption is large; conversely, the delay is large power consumption is small. Therefore, if the delay time is required, it is recommended to use the falling edge output.

Applications need to pay attention to.

  1. open-drain and open-collector principle is similar, in many applications we use open-collector circuit instead of open-drain circuit. For example, an input Pin is required to be driven by an open-drain circuit. The common way to drive it is to use a triode to form an open-collector circuit to drive it, which is convenient and cost-saving. As Figure 3
dbb035fc-67d6-11ed-8abf-dac502259ad0.jpg
  1. The resistance value of pull-up resistor R pull-up determines the speed along the logic level transition. The higher the resistance value, the lower the speed and the lower the power consumption. And vice versa.

Push-Pull output is generally known as push-pull output, in CMOS circuits should be more appropriate than CMOS output, because the push-pull output capability in CMOS can not be done as large as the bipolar. The output capability depends on the area of the IC internal output pole N tube P tube. Compared to the open drain output, the high and low levels of push-pull are determined by the IC’s power supply, which cannot simply do logic operations, etc. Push-pull is now the most used output stage design method in CMOS circuits.

Of course, open drain is not without its cost, which is the poor drive capability of the output. OD only brings the rising edge delay, because the rising edge is charged to the load through an external pull-up passive resistor, when the resistor is selected when the delay is small, but the power consumption is large, and vice versa, the delay is large power consumption is small. open drain provides a flexible output mode, but also has a cost, if the delay If there is a requirement for delay, it is recommended to use falling edge output.

The prerequisite for small resistance and small delay is that the principle of resistor selection should be within the allowable range of power consumption of the final transistor. Experienced designers using logic chips will not choose a 1 ohm resistor as a pull-up resistor. In the rising edge of the pulse the power supply charges the load through the pull-up passive resistor, obviously the smaller the resistance the shorter the rising time, in the falling edge of the pulse, in addition to the load discharging through the active transistor, the power supply also forms a path to ground through the pull-up resistor and the conducting transistor, bringing the problem of power consumption and power consumption of the chip. The resistor affects the rising edge, not the falling edge. If the rising edge is not a concern in use, the pull-up resistor can be chosen as large as possible to reduce the current to ground. If the rising edge time requirements are high, the choice of resistor size should be based on the chip power consumption as a reference.

    GET A FREE QUOTE

    FPGA IC & FULL BOM LIST

    We'd love to

    hear from you

    Highlight multiple sections with this eye-catching call to action style.

      Contact Us

      Exhibition Bay South Squre, Fuhai Bao’an Shenzhen China

      • Sales@ebics.com
      • +86.755.27389663