Current absorption, pulling current output, and filling current output
Pulling is a leak, active output current, output current from the output port;
Fill is filled, passive input current, inbound from the output port;
The suction is the active suction current, which flows in from the input port.
Current absorption and current filling are the current flowing from the chip's external circuit to the chip through the pins. The difference is that the current absorption is active, and the incoming current from the chip input end is called the absorption current. The inbound current is passive. The inbound current from the output end is called the inbound current. The outbound current is the output current provided by the digital circuit to the load, when the current is filled, the output low level is the external input current to the digital circuit. These are actually the input and output current capabilities.
The pulling current output can only output a few milliliters of current at the backend. It is unreasonable to use this method to drive the diode light-emitting (because the normal operating current of the light-emitting diode is 5 ~ 10mA ).
Up/down resistance
I. Definition
1. Pulling up is to embed uncertain signals in a high level through a resistor! "Resistance simultaneously throttling "! The same is true for the drop-down!
2. the pull-up operation injects current into the device, and the drop-down operation is the output current.
3. the weak ones only have different resistance values for the pull-up resistor. There is no strict distinction between them.
4. The ability of non-collector (or drain) open-circuit output circuits (such as common door circuits) to increase current and voltage is limited, the pull-up resistance function is mainly used for the output current channel of open collector output circuit.
Ii. Pulling Resistance
1. When a single key is used for trigger, if the IC itself does not have an internal resistance, in order to make the single key remain in the not triggered status or return to the original status after being triggered, A resistor must be connected to the outside of the IC.
2. There are three states of digital circuits: high level, low level, and high resistance. In some applications, high resistance is not expected, you can use the up or down resistor to make it stable, depending on the design requirements!
3. Generally, I/O ports can be set, some cannot be set, some are built-in, and some need external connections. The output of I/O ports is similar to that of a transistor C, when C is connected to the power supply through a resistor, the resistor becomes the upper C resistor, that is, if the port is normal, it is high; when C is connected to the ground through a resistor, the resistor is called a drop-down resistor, so that the port is usually at a low level. Does it work? For example: "When a port connected with an active/standby resistor is set to the input state, its normal state is high, which is used to detect low-level input ".
4. the pull-up resistor is used to provide current when the bus drive capability is insufficient. It is generally called pulling current, and the drop-down resistance is used to absorb the current, which is also called filling current.
5. The connection resistance is used to prevent the input from being suspended.
6. Reduce the interference of external current on the chip
7. Protection of protection diodes in CMOS. Generally, the current is not greater than 10mA.
8. Increase or decrease the drive current by pulling up or pulling down
9. Changes the potential of the level, often used in TTL-CMOS matching
10. Fixed status when pin is suspended
11. Increase the driving capability for High-level output.
12. Provide current for OC Gate
Iii. Application Principles of pull-up Resistance
1. When the TTL circuit drives the COMs circuit, if the high level output by the TTL circuit is lower than the lowest high level (generally 3) of the COMs circuit. 5 V), then you need to connect the pulling resistance at the TTL output end to increase the output high level.
2. OC door circuit "must be added with a pull resistance to use ".
3. In order to increase the drive capability of the output pin, some single-chip microcomputer pins often use the pull-up resistor.
4. On the COMs chip, in order to prevent damage caused by static electricity, unused pins cannot be left blank. Generally, the pulling resistance is connected to reduce the input impedance and the leakage path is provided.
5. Increase the output level by adding a pull resistor to the Chip Pin, thereby improving the noise tolerance of the chip input signal and enhancing the anti-interference capability.
6. Improve the anti-electromagnetic interference capability of the bus. When the PIN is left blank, it is easier to accept external electromagnetic interference.
7. During long-line transmission, the interference of the reflected wave is easily caused by the mismatch of the Resistance. In addition, the drop-down resistance is used to effectively suppress the interference of the reflected wave.
8. Input feet that are not used in digital circuits must be connected to a fixed level and connected to a high level or ground through a 1 K resistor.
Iv. Principle of selecting the resistance of the pull-up Resistor
1. Considering Power Consumption Reduction and chip current filling capacity, it should be large enough; the resistance should be large and the current should be small.
2. Make sure that the driving current is sufficient, the resistance is small, and the current is large.
3. for High-Speed Circuits, excessive pull-up resistance may smooth the edge. Comprehensive Consideration
The preceding three points are usually selected from 1 K to 10 K. The drop-down resistance is similar.
The selection of the pull-up and drop-down resistors should be "set based on the characteristics of the switch and the input characteristics of the lower-level circuits. The following factors must be taken into account ":
1. Balance between drive capability and power consumption. The above pull resistance is used as an example. Generally, the smaller the pull resistance, the stronger the driving capacity, but the larger the power consumption, the design should pay attention to the balance between the two.
2. Driver requirements of lower-level circuits. In the same case, when the output is high, the switch is disconnected, and the pull-up resistor should be properly selected to provide sufficient current to the lower-level circuit.
3. Set the level. The threshold levels of different circuits are different. The resistance should be properly set to ensure that the correct levels can be output. The above pulling resistance is used as an example. When the output is low, the switch turns on. The uppulling resistance and the switch turn on resistance values must be under the zero threshold.
4. Frequency features. The above pulling resistance is used as an example. The input capacitance between the uplink pulling resistance and the drain source level of the switch will form an "RC delay". The larger the resistance, the larger the delay. The requirements of the circuit should be considered for the setting of the pull-up resistor.
The Setting principle of the drop-down resistor is the same as that of the top-down resistor.
Example:
The high-voltage output of the OC gate is usually a high-impedance mode. The pull-up current must be provided by the pull-up resistor, so that each port at the input end cannot exceed UA, and the output port drive current is about UA, the standard operating voltage is 5 V, and the threshold of the input port is 0. 8 V (below this value is low); 2 V (high threshold ).
When selecting the pull-up Resistor: 500ua x 8. 4 k = 4. 2: select more than 8. When 4 K is used, the output end can be pulled down to 0. Below 8 V, this is the minimum resistance, and it will not be able to be pulled. If the output port drive current is large, the resistance value can be reduced to ensure that the drop-down speed is lower than 0. 8 V. When the output power is high, the leakage current of the pipe is ignored. The two input ports must be 200ua and 200ua x15k = 3 V, that is, the pressure drop of the upstream resistance is 3 V, and the output port can reach 2 v, this is the maximum resistance, and the larger the value is less than 2 v. Select 10 K. [Maximum voltage drop/maximum current, minimum voltage drop/minimum current]
The COMS door can refer to the 74hc series design when the pipe leakage stream can not be ignored, the actual current of the IO port is also different at different levels, the above is only the principle, a sentence is summarized: "The output high-power supply usually needs to feed the rear input port, and the output low-level should not feed the output port." (otherwise, the excess current is fed to the cascade input port, higher than the low-level threshold is unreliable)
In addition, pay attention to the following points:
A. It depends on what device is driven by the output port. If the device requires a high voltage and the output voltage of the output port is insufficient, a pulling resistance is required.
B. If there is an upper-tension resistor, its port is high by default. to control it, you must use a lower level to control the collector of a three-state gate circuit transistor, or the diode cathode is used to control the current of the pull-up resistor to a low level. Conversely,
C. This method is generally used in the interface circuit to obtain the determined level to ensure the correct circuit status to avoid accidents. For example, in the control of the motor, the lower axle arm of the inverter bridge cannot be directly connected. If they are driven by the same single-chip microcomputer, the initial state must be set. Prevent passthrough!
The drive should be filled with current whenever possible.
----------------------------------------
The input feet that are not used in the digital circuit must be connected to a fixed level and connected to a high level or ground through a 1 K resistor.
1. Resistance:
L The connection resistance is used to prevent the input from being suspended.
L weaken the interference of external current on the chip
L protection of protection diodes in CMOS, the general current is not greater than 10mA
L pull up, pull down, and throttling
1. The potential of changing level, often used in TTL-CMOS matching
2. Fixed status when pin is left blank
3. Increase the drive capability for High-level output.
4. Supply current for OC Gate
It depends on what device is driven by the output port. If the device requires a high voltage and the output voltage of the output port is not enough, a pulling resistance is required. If there is an upper-tension resistor, its port is high by default. to control it, you must use a lower level to control it, such as the Collector of a three-state gate circuit transistor, or the diode cathode is used to control the current of the pull-up resistor to a low level. On the contrary, this method is especially used in interface circuits. To obtain a definite level, this method is generally used to ensure the correct circuit status to avoid accidents. For example, in motor control, the lower axle arm of the inverter bridge cannot be directly connected. If they are driven by the same single-chip microcomputer, the initial state must be set. Prevent passthrough!
When selecting resistance, select the one with the highest standard value after calculation!
P0:
1. Maximum Pulling Resistance in P0 Port
2. When P0 is in the I/O port operating state, the top FET is turned off, so that the output foot is flushed. Therefore, P0 is used for the open/drain output when the output line is used.
3. The top FET is shut down because of the maximum pull resistance in the chip. When P0 outputs 1, the port level cannot be increased.
P0 is a bidirectional port, and other P1, P2, and P3 are quasi bidirectional ports. The quasi-two-way interface is used to prepare external data. Why?
When reading the port of the quasi-bidirectional port, the microcontroller should first assign 1 to the port latches to enable the FET to be shut down, so that the port is not stuck at a low level due to the on-chip FET conduction.
Generally, select 10 K for up/down pulling!
Function of chip pull-up/drop-down resistance
The most common purpose is to assume that there is a three-state door with a lower-level door. If the output of the three States is directly connected to the input of the next level, when the gate of the three states is a high-impedance state, the input of the next level is just like a float. It may cause logical errors, which may be destructive to the mos circuit. Therefore, the input at the next level is pulled up or down with a resistor, which does not affect the logic and ensures that the input is not left blank.
Changes the potential of the level, often used in TTL-CMOS matching; when the PIN is left blank, there is a definite state; provide the current for the output of the OC door; as the end resistance; in the test board is equal to an additional test point, especially for the board with more than one chip, so as not to cut the line; embedded;
The top and drop-down resistors have many functions, such as raising the signal peak value, enhancing the signal transmission capability, preventing online reflection during long-distance signal transmission, and adjusting the signal level! Of course, there are other functions. The specific application method depends on the scenario and purpose, and the parameters cannot be set all the time. It depends on other parameters of the circuit, for example, if the pull-up resistance is usually used on the input foot to lift the peak value, it is necessary to refer to the internal resistance of the pin to set the resistance value! In addition, it is not said that the input is added with a drop-down, and the output is added with a pull. Sometimes there may be both a pull-up and a drop-down resistor without a specific purpose!
Add Grounding Resistance-drop down
Add power resistor -- pull up
For devices with open drain or open collector outputs, a pulling resistor is required to work. In addition, the common port and the pulling resistance can improve the anti-interference capability, but will increase the load.
Power Supply: + 5 V
Ordinary upright led,
What is the proper pull-up resistance? Thank you for your advice!
Generally, a few Ma is enough for the LED current, and the maximum value is no more than 20mA. Based on this, you can calculate the pull-up resistance value.
For the sake of insurance, let him pull it. (5-0.7)/10mA = 400ohm. It's almost the same. If you don't feel relieved, use 2 K. [Strange, is there a new LED with a pipe pressure of 0.7v? As far as I know, it seems to be around 1.5v. I don't think it's a big problem to watch hundreds of euros or even 1 K. The average film won't go down to 10mA, will it be hard to resist ?]
Drop-down resistance: there are not many observations. It is common to be connected to the input of a device and used mostly for anti-interference. This is because the input of a general IC is prone to interference when it is suspended, or the gap leakage voltage during device scanning affects the circuit performance. The latter, we have encountered in a batch of devices.
The resistance value of the pull-up resistor mainly takes into account the ability of low-level suction current on the port. For example, adding a 1 K pull-up resistor at a 5 V voltage will increase the suction current by 5mA for the low-level port. When the port can withstand the conditions, it is better to increase the resistance slightly.
------------------------------------------
BBS is discussed as follows:
When do I need to use a pull resistor? When do I need a drop-down? How much resistance should I use?
--------------------
Use pull or drop-down based on the level you usually need.
As for the resistance value, if it is a general IO port, about 10 K, not less than 1 K. However, for special purposes, there are special requirements. For example, the maximum and minimum values of the uplink resistance must be calculated based on the actual situation, for example, the SCL and SDA lines of the I2C interface.
--------------------
Generally, in digital circuits, pull-up is used to improve the driving capability. For example, open collector output circuit. The pulling resistance must be added. Otherwise, the device of the next level cannot be driven. Or, pull up and pull down at the same time, for example, on the data and address bus. It is used to clamp the level in a potential when no output is available. Do not drop down empty feet to prevent lock.
--------------------
1. The signal requires an external power supply to provide high and low power, and requires a pull or drop-down resistor;
2. Although the system can provide the corresponding level, if the signal status needs to be high or low when it is not working, add a pull or drop-down;
3. When the output of the IC is open-drain, a pulling resistance must be added to the external device.
The pull-up or pull-down resistance depends on the signal driving capability and signal requirements. Commonly used include 10 K, 100 k, and 47k. However, the size of some pull-up or drop-down resistors depends on the experiment.
--------------------
The connection between the pull-up and the drop-down resistance in the circuit is obtained through calculation. There are three possible links:
1. The size of the input current of the driver, which must be considered when pulling up. The solution is high-level matching.
2. The speed of the circuit. If the transmission speed of the digital information is high, check whether the delay of the line is out of the turning frequency of the information.
3. It is related to the input and output current capacity of the responsible end and needs to be verified to be able to withstand it.
--------------------
The reason why the pull-up and drop-down resistors are required is to provide an additional current path for the unmatched current interface. Specifically, when the output current of the driver is less than the suction current of the load side, the pull-up resistor is added, in order to provide additional current supply; when the driving side inhaled current is less than the load side's outbound current, add a drop-down resistor to provide additional current discharge circuit; the additional effect of the pull-up and drop-down resistors is that there is a fixed level when the interface is not driven (this feature is often used in the initial and idle state of the fixed port line ). The selection of resistance values should be calculated based on the allowable current of one party that flows through a small amount of current, so as not to exceed its allowed value (the device manual has) (considering that the power supply fluctuation should not exceed the allowable value of its port line ).
--------------------
The value of pull-up resistance should take into account the suction current, fan-out current and signal transmission speed, and be smaller in the high-speed circuit to prevent the influence of the distribution capacitance of the line.
--------------------
I think there are two types of pull-up and drop-down resistors: one is mandatory, for example, key acquisition, the other is that addition can not be applied to the realization of the circuit principle does not have any impact, this type of resistance is mainly used to enhance the system's anti-interference performance, the value is generally about 1mA OK
------------------------------------------
High Impedance:
In the high-impedance mode, there is only the capacitance effect, and there is no resistance effect. The impedance is very high, which is equivalent to disconnecting;
----
I think if it is for the IC input signal. The high-impedance mode is the input voltage between the high voltage and the low level. IC cannot accurately determine it as 0 or 1, at this time, the output status of the IC is unstable (if the output signal of the IC is different when 0 and 1 are input), an error may occur.
For the output signal of an IC, if it is a high-impedance output, it represents a high impedance and can be considered as disconnected.
----
A high-impedance state refers to an output state of a circuit. It is neither a high-voltage nor a low-level State. If a high-impedance state is input to a lower-level circuit, it has no effect on the lower-level circuit, if A multimeter is used for testing, it may be either a high level or a low level, depending on what is next to it.
The essence of high impedance mode: when analyzing a circuit, the high impedance mode can be understood as an open circuit. You can think of it as a very large output (input) resistor. His limit can be considered to be suspended. That is to say, in theory, the high-impedance state is not suspended. It is a State with great resistance to the ground or power supply. The actual application is the same as that of the pin.
Typical applications:
1. In the structure of the bus connection. There are multiple devices mounted on the bus, and the devices are connected to the bus in the form of high resistance. In this way, the bus is automatically released when the device does not occupy the bus to facilitate other devices to obtain the right to use the bus.
2. Most single-chip I/O applications can be set to high-impedance input, such as lingyang and AVR. High-impedance input can be considered as infinite input resistance, and I/O has a very small impact on the front-level without generating current (no attenuation ), to some extent, it also increases the chip's ability to resist voltage impact.
If p0.0 of 51 is in a high-impedance state, how is it expressed in assembly language? Set it to 1.
A three-state gate refers to a gate circuit in the high-impedance state, in addition to the two states of high and low-level output. A device in these three States is called a three-state device (gate, bus ,......).
High level, low level can be increased and pulled down by the internal circuit. In the high-impedance mode, the ground-to-ground resistance of the pin is infinite. At this time, the read pin can usually read the real level value. One of the important functions of the high-impedance mode is that the I/O (input/output) port is used to read the external level during input.
The high-impedance state is equivalent to the disconnection State between the gate and its connected circuit. (Because it is impossible for you to disconnect it in the actual circuit, you can set such a State to make it disconnected ). A three-state gate is an output-level extension logic function and a control switch. It is mainly used for bus connection, because the bus only allows one user at the same time. Generally, multiple devices are connected to the data bus. Each device is selected through signals such as OE/CE. If the device is not switched, it is in the high-impedance state, which is equivalent to not connected to the bus and does not affect the work of other devices.
If your device port is to be mounted on a bus, "It must pass through a three-state buffer ". Because only one port can be output at the same time on a bus, other ports must be in the high-impedance state and "data of this output port can be input ". Therefore, you also need to have bus control and management, which port can be accessed, and the three-state buffer of that port can be transferred to the output state. This is a typical three-state gate application. If there are no more than two output devices online, of course, there are no three-state gates, and the line or logic is another matter.
----------------------
Differences between a quasi-bidirectional port and a bidirectional Port
In the first 51 series microcontroller
P0 port: bidirectional 8-bit tri-state I/O port
P1 port: quasi-bidirectional 8-bit I/O port
P2 port: quasi-bidirectional 8-bit I/O port
P3 port: quasi-bidirectional 8-bit I/O port
In particular, the differences between quasi-bidirectional and bidirectional triplicate I/O are required:
Port P1, port P2, and port P3 are three 8-bit quasi-bidirectional I/O Ports. Each port has a fixed pull-up resistance in the chip, when these three quasi-bidirectional I/O ports are used as input ports, you must first write 1 to the port, and the quasi-bidirectional I/O ports do not have a high-impedance "floating" status.
The P0 port of the two-way port does not have a fixed pull-up resistance. It is connected by two MOS tubes, which can both open and leak the output and be in a high-impedance "float" state, it is called a bidirectional three-state I/O port.
When the P0 port is used as the address/data port, The P0 port is in the push-pull status of both switches. When both switches are closed, the high-impedance status will appear.
When P0 port is used for general I/O Ports, the switch that internally connects to VCC is out of contact with the pin (port). At this time, only the switch that pulls the ground works, the P0 port is used as the output and must be an external pull-up resistor. Otherwise, the high level cannot be output. If the P0 port is used as the input, you must first write 1 to the port to disconnect the switch that pulls the ground, at this time, if the pull resistance is not connected, it is in the high resistance state, which is a bidirectional port. If the pull resistance is connected, the output level is high, there is no impact on the logic of the input signal (note that there is no impact on the logic, and there is no impact on the actual parameters, I am not sure, but I think there is ).
Two-way and quasi-two-way, the fundamental principle is that two-way includes the High-resistance state, not whether to write 1 first or not, P1 ~ The P3 port has internal pull-up resistance, so it is not bidirectional in any case; The P0 port has no internal pull-up resistance. When it is in the data/address function, it automatically completes the three-state conversion, which is bidirectional, in general I/O port, if the port is not pulled externally and 1 is first written to the port, the port is in a high-impedance state. At this time, it is also a human's two-way port, this is different from the automatic bidirectional routing when it is in the address/data function, and from P1 ~ When P3 is input, the output latch is 1.
--------------------------------------------------
Differences between floating and high-impedance Modes
Floating (floating): The input pin of the logical device is not connected to a high level or a low level. Because of the internal structure of the logical device, when its input pin is left blank, it is equivalent to the Pin connected to a high level. In actual use, pin is not recommended to be left blank and is vulnerable to interference.
High-impedance mode: In the internal circuit structure of a logical device, the output resistance is very high. This mode is neither high nor low. When a three-state gate is in a high-impedance state, no matter how the input of the gate changes, it will not contribute to its output.
---------------------------------------
Line drive (differential output)
The linear drive is a source current output device. In the on status, the output of the wire drive is a power supply (VCC). When the power is off, the output is suspended. Therefore, the wire driver requires an input interface for filling current. The following table provides a simple schematic of the wire driver.
Differential output, linear driving output: is based on the rs-422a data transmission circuit. Long-distance transmission can be achieved through dual-strand cable.
Open collector push-pull wire drive
Open collector
The open collector circuit is a current filling output device. In the off state, the open collector output is connected to the ground; In the on state, the open collector output is suspended. Therefore, the open-collector output requires a source current input interface. The following table shows a simple principle of open collector output circuit.
Push-pull
The push-pull output combines the wire drive with the open collector output. when the power is turned off, the push-pull output is grounded. when the power is turned on, the push-pull output is connected to the power supply (VCC ). Two types of output circuits are available for the push-pull output (called the complementary output by OMRON), that is, the output of the two transistors, that is, the and the pnp2. Based on the output signal H or l, the two transistor outputs cross each other to perform the ON or OFF action. in use, the positive power supply and 0 V are respectively for the suction, pulling and dropping complementary outputs are two types of actions: output current outflow or inflow. They feature high signal rising and falling speeds and can be extended over long distances. It can be connected to the open collector Input machine (PNP/PNP) and the voltage input machine. However, in order to better utilize the future performance, it is generally recommended to use the voltage input encoder on the voltage input machine.
The OC gate is mainly used in three aspects:
1. Implement and non-logic, use level conversion and drive. Because the collector of the output tube of the OC gate circuit is suspended, an external pull-up resistor RP must be used to power the VCC. The OC door uses a pull-up resistor to output a high level. In addition, in order to increase the drive capability of the output pin, the principle of selecting the pull-up resistor resistance is as follows, it should be large enough to reduce power consumption and chip current filling capacity, and small enough to ensure sufficient driving current.
2. Line and logic, that is, the two output ends (including more than two) can be directly connected to implement the "and" logic function. In practical applications such as bus transmission, the output ends of Multiple doors need to be connected in parallel. Generally, the output ends of TTL doors cannot be directly connected, otherwise, a large short-circuit current (fill current) is formed between the output tubes of these doors due to low impedance, and the device is burned out. On the hardware, it can be implemented by oC or tri-state gate (ST gate. When the OC door is used to achieve the line and the output port, a pulling resistance should be added at the same time.
3. Three-state gate (ST gate) is mainly used for multiple gate outputs to share the data bus. To prevent multiple gate outputs from occupying the data bus at the same time, the enabling signals of these gates (en) only one valid level (such as high level) is allowed, because the output of the three-state gate is a low-resistance output of the pull type, and the pulling (load) resistance is not required, therefore, the switching speed is faster than that of the OC gate, and the three-state gate is often used as the output buffer.