What is open collector (OC )? What is open circuit (OD )? Why do I have to add a pulling resistance to the IO port output by the OC gate? What is push-pull output?

Source: Internet
Author: User

Copyright Disclaimer: During reprinting, please use hyperlinks to indicate the original source and author information of the article and this statement
Http://zhaoleijun.blogbus.com/logs/25227570.html

 

What is open collector (OC )?

Let's talk about the structure of open collector output. As shown in structure 1 of open collector output, the transistor on the right has no collector, so it is called open collector (the transistor on the left is used for reverse conversion, when the input is "0, the output is also "0 "). For Figure 1, when the input on the left side is "0", the front transistor cutoff (that is, the gap between the collector C and the emission pole e is equivalent to disconnecting ), therefore, the 5 V power supply is added to the transistor on the right through a 1 K resistor, And the transistor on the right (that is, a switch is closed). When the input on the left side is "1", the front transistor is turned on, while the end of the transistor (equivalent to switching off ).

We simplified figure 1 to figure 2. The switch in Figure 2 is under software control. It is disconnected when "1" and closed when "0. Obviously, when the switch is closed, the output is directly grounded, so the output level is 0. When the switch is disconnected, the output end is suspended, that is, the high-impedance state. The level status is unknown. If a resistance load (even a light load) arrives at the ground, the output level will be pulled to a low level by the load, therefore, this circuit cannot output a high level.
See figure 3. In Figure 3, the 1 K resistance is the pull-up resistance. If the switch is closed, the current will flow from the 1 K resistor and the switch, but because the switch is closed and the current resistor is 0 (It is convenient for us to discuss that the switch resistor is not 0 in actual situations, in addition, the transistor still has a saturation pressure drop), so the voltage on the switch is 0, that is, the output level is 0. If the switch is disconnected, the switch resistance is infinite (same as above, regardless of the actual leakage current), so the current flow is 0, so the pressure drop on the 1 K resistance is also 0, therefore, the output voltage is 5 V, so that the output can be high. However, the internal resistance of the output is relatively large (1 k Ω). If a load with a resistance of R is connected, it is calculated by partial pressure, the final output voltage is 5 * r/(R + 1000) V, that is, 5/(1 + 1000/R) v. Therefore, r cannot be too small to reach a certain voltage. If R is too small and the output voltage is not enough, we can increase the driving capability by reducing the 1 K pull-up resistance. However, the pull-up resistance cannot be too small, because when the switch is closed, the current will be generated. Because the current that the switch can flow through is limited, the value of the pull-up resistance is limited, in addition, when the output power is low, the load may also provide a part of the current flowing through the switch. Therefore, we need to consider the current to choose the appropriate pull-up resistance.
If we connect the input end of a read data to the output end, this is an I/O port (the 51 I/O port is in this structure, where the P0 port is not pulled internally, the other three ports are pulled up internally). When we want to use the input function, we only need to set the output port to 1, which is equivalent to disconnecting the switch, for P0 port, it is a high-impedance state.
What is open circuit (OD )?
For open-circuit (OD) output, the output is very similar to that of Open-collector output. Replace the above transistor with a Fet. In this way, the collector becomes the drain pole, the OC becomes the OD, And the principle analysis is the same.
Another output structure is push-pull output. The structure of the push-pull output is to replace the above pull-up resistor with a switch. When high-power output is required, the switch above is enabled and the switch below is disconnected. When low-power output is required, the opposite is true. Compared with OC or OD, such a push-pull structure has high and low-level drive capabilities. If two output ports of different levels are connected together, a large amount of current will be generated, and the output ports may be burned out. The OC or OD output mentioned above will not be like this, because the current provided by the pull-up resistor is relatively small. If the push-pull output is to be set to a high-impedance state, the two switches must be disconnected at the same time (or use a transport door on the output port), which can be used as the input state, some Io ports of the AVR Microcontroller are in this structure.

 

Alternate illustration:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.