当前位置:网站首页>OC, OD, push-pull explanation of hardware

OC, OD, push-pull explanation of hardware

2022-07-07 03:06:00 ltqshs

 Insert picture description here

Clear and push-pull 、 Open a leak 、OC、OD

Push pull output

Push pull output (Push-Pull Output) It's made up of two MOS Or the triode is controlled by complementary control signals , The two tubes are always in the state that one is on and the other is off , Pictured 1 Shown :

 Insert picture description here

chart 1 Push pull output structure
The biggest feature of push-pull output is that it can really output high-level and low-level , And it has driving ability at both levels .

Additional explanation :

The so-called drive capability , It means the ability to output current . For driving large loads ( That is, the smaller the internal resistance of the load , The greater the load ) when , for example IO Output is 5V, The load internal resistance of the drive is 10ohm, Therefore, according to Ohm's law, the current on the load under normal conditions is 0.5A( The calculated power is 2.5W). Obviously, it's just IO It is impossible to have such a large driving capacity , That is, there is no way to output such a large current . As a result, the output voltage will be pulled down , Not up to nominal 5V. Of course, if it's just the transmission of digital signals , Theoretically, the input impedance of the next stage should be high impedance , That is, it only needs to transmit voltage , There is almost no current , There is no power , So you don't need a lot of driving power .

For push-pull output , High output 、 The flow direction of current at low level is shown in the figure 2 Shown . So compared with the open drain output introduced later , When the output is high, the driving ability is much stronger .

 Insert picture description here

chart 2 Filling current and pulling current

shortcoming

But one disadvantage of push-pull output is , If two push-pull output structures are connected together , An output high level , It's the one above MOS Conduction , Below MOS When closed ; At the same time, the other output is low , It's the one above MOS closed , Below MOS Conduction time . The current will flow from the first pin VCC Through the upper end MOS Then pass through the lower end of the second pin MOS Direct flow to GND. The resistance on the whole path is very small , There will be a short circuit , This may cause damage to the port . This is also why push-pull output cannot be realized " Line and " Why .

Open drain output

It is often said that the open drain output is opposite to the push-pull output (Open Drain Output), For the difference between open drain output and push-pull output, the most common saying is that open drain output cannot really output high level , That is, there is no driving ability at high level , It is necessary to complete external drive with the help of external pull-up resistance . For the pull-down resistance, please refer to this article : Easy to understand STM32 The top of the middle / Pull down resistance .

The following explains why the open drain output has no driving ability when the output is high from the internal structure and principle , And further compare with push-pull output .

First, we need to introduce some open drain outputs (OD) And open set output (OC). The principles and characteristics of these two outputs are basically similar , The difference between the following :

Open the leak and use MOS tube , Among them " leak " Refers to MOS The leakage pole of the tube

Open set uses triode , Among them " Set " It refers to the collector of the triode

Both of the these are output modes corresponding to push-pull output , Due to the use MOS There are many cases of pipe , Many times I use " Open drain output " This word replaces open drain output and open set output .

OC

The introduction starts with the open set output , Its principle circuit structure is shown in the figure 3 Shown .

 Insert picture description here
chart 3 OC
chart 3 The circuit on the left is open (OC) Output the most basic circuit , When the input is high ,NPN Triode conduction ,Output Pulled to GND, The output is low level ; When the input is low ,NPN The triode is closed ,Output It's the equivalent of an open circuit ( High output resistance ). High output resistance at high level ( High resistance 、 Three states and floating They all mean the same thing ), At this time, there is no external driving capability . This is the biggest characteristic of open drain and open set output , How to use this feature to complete various functions will be introduced later . Although this circuit completes the function of open set output , But there will be input For the high , The output is low ;input For low , The output is high .

chart 3 The circuit on the right uses a triode to complete " Reverse phase ". When the input is high , The first triode turns on , At this time, the input end of the second triode will be pulled to GND, So the second triode closes , High output resistance ; When the input is low , The first triode is closed , At this time, the input end of the second triode will be pulled to the high level by the pull-up resistor , So the second triode turns on , The output is pulled to GND. such , The input and output of this circuit are in phase .

OD

Next, the open drain output circuit is introduced , Pictured 4 Shown . The principle is basically the same as that of open set output , Just replaced the triode with MOS nothing more .

 Insert picture description here

chart 4 OD
Features and Applications

Then let's talk about opening and leaking 、 Characteristics and applications of open set output , Because they are similar , Unless otherwise specified in the following text , Then open drain is used to represent open drain and open set output circuits .

The main characteristic of open drain output is high level and no driving ability , The external pull-up resistor is needed to really output high level , Its circuit is shown in the figure 5 Shown .
 Insert picture description here

chart 5 OD Door pull up
When MOS When the tube is closed , Open drain output circuit outputs high level , When the load is connected , The current flows from an external power source , Flow through the pull-up resistor RPU, Flow into the load , The last to enter GND.

An obvious advantage of this characteristic of open drain output is that it can easily adjust the output level , Because the output level is completely determined by the power level connected by the pull-up resistor . So where level conversion is needed , Very suitable for open drain output .

Another advantage of this feature of open drain output is that " Line and " function , So-called " Line and " It refers to the direct connection of multiple signal lines , Only when all signals are high , The combined bus is high level ; As long as any one or more signals are low , Then the bus is low . And push-pull output is not , If the high and low levels are connected together , There will be current backflow , Damage to the device .

push-pull 、 Open leak comparison

 Insert picture description here

About push-pull output 、 Open drain output at STM32 Application in , Please move on to this article :STM32 in GPIO How it works . Straighten out the push-pull 、 After opening the leak , You can understand it a little bit better GPIO working principle .

Statement : The copyright belongs to the original author , In case of infringement, please contact Xiaobian to delete . Reference to the original 1:《 Hardware circuit design “OC/OD Output ”》, Reference to the original 2:《 Clear and push-pull 、 Open a leak 、OC、OD》.

原网站

版权声明
本文为[ltqshs]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061931524181.html