Use of pull-up and pull-down resistors

Publisher:钱币之歌Latest update time:2015-09-29 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Current sinking, current sourcing, current sinking

Pull to release, actively output current, output current from the output port;

Filling means charging, passive input current flows into the output port;

Absorption is the active absorption of current, flowing into the input port.

   Sinking current and sinking current are the currents flowing from the chip external circuit through the pins into the chip; the difference is that absorbing current is active, and the current flowing from the chip input end is called absorbing current. Sinking current is passive, and the current flowing from the output end is called sinking current; sourcing current is the output current provided by the digital circuit to the load when the digital circuit outputs a high level, and the output low level when sinking current is the external input current to the digital circuit. These are actually the input and output current capabilities.

    The current pull output can only output a few milliamperes of current for the inverter. It is unreasonable to use this method to drive the diode to emit light (because the normal working current of the light-emitting diode is 5~10mA).

Pull-up and pull-down resistors

I. Definition

1. Pull-up means clamping the uncertain signal at a high level through a resistor! "The resistor also acts as a current limiter"! The same applies to pull-down!

2. Pull-up is to inject current into the device, and pull-down is to output current

3. Weak and strong are just different in the resistance value of the pull-up resistor, there is no strict distinction

4. For non-collector (or drain) open-circuit output circuits (such as ordinary gate circuits), the ability to increase current and voltage is limited. The function of the pull-up resistor is mainly to output the current channel for the collector open-circuit output circuit.

2. Pull-up resistor function

1. Generally, when used as a single-key trigger, if the IC itself does not have an internal resistor, in order to keep the single key in an untriggered state or return to the original state after being triggered, a resistor must be connected outside the IC.

2. Digital circuits have three states: high level, low level, and high resistance state. In some applications, high resistance state is not desired. It can be stabilized by using pull-up resistors or pull-down resistors, depending on the design requirements!

3. Generally speaking, I/O ports are referred to as ports. Some can be set, some cannot be set, some are built-in, and some need to be externally connected. The output of the I/O port is similar to the C of a transistor. When C is connected to the power supply through a resistor, the resistor becomes the C pull-up resistor, that is to say, if the port is normally at a high level; when C is connected to the ground through a resistor, the resistor is called a pull-down resistor, making the port usually at a low level. What is its function? For example: "When a port connected to a pull-up resistor is set to input state, its normal state is high level, which is used to detect low level input".

4. Pull-up resistors are used to provide current when the bus driving capability is insufficient. Generally speaking, it is called pulling current, and pull-down resistors are used to absorb current, which is what we usually call sinking current.

5. Connecting a resistor is to prevent the input terminal from being left floating

6. Reduce the interference of external current on the chip

7. Protect the protection diode in CMOS, the current is generally not more than 10mA

8. Increase or decrease the drive current by pulling up or down

9. Potential that changes the level, commonly used in TTL-CMOS matching

10. There is a certain state when the pin is floating

11. Increase the driving capability at high level output.

12. Provide current for OC gate

3. Application principles of pull-up resistors

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 of the COMS circuit (generally 3.5V), it is necessary to connect a pull-up resistor to the output end of the TTL to increase the value of the output high level.

2. The OC gate circuit "must be added with a pull-up resistor before it can be used."

3. In order to increase the driving capability of the output pins, pull-up resistors are often used on some microcontroller pins.

4. On COMS chips, in order to prevent damage caused by static electricity, unused pins cannot be left floating. Generally, pull-up resistors are connected to reduce input impedance and provide a discharge path.

5. Add pull-up resistors to the chip pins to increase the output level, thereby improving the noise tolerance of the chip input signal and enhancing anti-interference capabilities.

6. Improve the anti-electromagnetic interference capability of the bus. If the pin is left floating, it is more susceptible to external electromagnetic interference.

7. Resistance mismatch in long-line transmission can easily cause reflected wave interference. Adding a pull-down resistor can achieve resistance matching and effectively suppress reflected wave interference.

8. In digital circuits, unused input pins must be connected to a fixed level and connected to a high level or ground through a 1k resistor.

4. Pull-up resistor value selection principle

1. Considering power consumption and the chip's current sinking capability, it should be large enough; the larger the resistance, the smaller the current.

2. It should be small enough to ensure sufficient driving current; the smaller the resistance, the larger the current.

3. For high-speed circuits, excessively large pull-up resistors may cause the edge to become flat.

The above three points are usually selected between 1k and 10k. The same is true for pull-down resistors.

 

The selection of pull-up resistors and pull-down resistors should be "set in combination with the characteristics of the switch tube and the input characteristics of the lower circuit, mainly considering the following factors":

1. Balance between driving capability and power consumption. Taking the pull-up resistor as an example, generally speaking, the smaller the pull-up resistor, the stronger the driving capability, but the greater the power consumption. The design should pay attention to the balance between the two.

2. Driving requirements of the lower circuit. Taking the pull-up resistor as an example, when the output is high, the switch tube is disconnected, and the pull-up resistor should be appropriately selected to provide sufficient current to the lower circuit.

3. Setting of high and low levels. The threshold levels of high and low levels of different circuits will be different, and the resistors should be set appropriately to ensure that the correct level can be output. Taking the pull-up resistor as an example, when the output is low level, the switch tube is turned on, and the voltage divider value of the pull-up resistor and the switch tube on resistance should be ensured to be below the zero level threshold.

4. Frequency characteristics. Taking the pull-up resistor as an example, the capacitance between the pull-up resistor and the drain-source level of the switch tube and the input capacitance between the lower circuit will form an "RC delay". The larger the resistance, the greater the delay. The setting of the pull-up resistor should take into account the circuit's needs in this regard.

The principle of setting the pull-down resistor is the same as that of the pull-up resistor.

 

Example:

    When the OC gate outputs a high level, it is in a high-impedance state, and its pull-up current is provided by a pull-up resistor. Assume that the input current of each port is no more than 100uA, the output port driving current is about 500uA, the standard operating voltage is 5V, and the high and low level thresholds of the input port are 0.8V (lower than this value is a low level); 2V (high level threshold value).

    When selecting a pull-up resistor: 500uA x 8.4K = 4.2, that is, when it is greater than 8.4K, the output end can be pulled down to below 0.8V. This is the minimum resistance value. If it is smaller, it cannot be pulled down. If the output port driving current is large, the resistance value can be reduced to ensure that it can be lower than 0.8V when pulled down. When the output is high, ignoring the leakage current of the tube, the two input ports require 200uA, 200uA x15K=3V, that is, the pull-up resistor voltage drop is 3V, and the output port can reach 2V. This resistance value is the maximum resistance value. If it is larger, it cannot pull 2V. Select 10K for use. [Maximum voltage drop/maximum current, minimum voltage drop/minimum current]

    The COMS gate can refer to the 74HC series. The leakage current of the tube cannot be ignored when designing. The actual current of the IO port is also different at different levels. The above is just the principle. It can be summarized in one sentence: "When outputting a high level, feed the input port behind it, and when outputting a low level, do not feed the output port too much" (otherwise, the excess current will be fed to the cascade input port, and it will be unreliable if it is higher than the low level threshold value)      

 

In addition, the following points should be noted:

A. It depends on what device the output port drives. If the device requires a high voltage and the output voltage of the output port is not enough, a pull-up resistor needs to be added.

B. If there is a pull-up resistor, its port is at a high level by default. If you want to control it, you must use a low level to control it, such as the collector of a transistor in a three-state gate circuit, or the anode of a diode to control the current of the pull-up resistor to a low level.

C. Especially used in interface circuits, in order to obtain a certain level, this method is generally used to ensure the correct circuit state to avoid accidents. For example, in motor control, the upper and lower bridge arms of the inverter bridge cannot be directly connected. If they are driven by the same microcontroller, the initial state must be set. Prevent direct connection!

 

Try to use current sinking for driving.

 

----------------------------------------

In digital circuits, unused input pins must be connected to a fixed level, connected to a high level or grounded through a 1k resistor.
1. Function of resistor:
l Connecting resistors is to prevent the input terminal from floating
l Reduce the interference of external current on the chip
l Protect the protection diode in CMOS, generally the current is not more than 10mA
l Pull up and pull down, current limiting
1. Change the potential of the level, commonly used in TTL-CMOS matching
2. There is a certain state when the pin is floating
3. Increase the driving capability when the high level output.
4. Provide current for OC gate

 

    It depends on what device the output port drives. If the device requires a high voltage, and the output voltage of the output port is not enough, a pull-up resistor needs to be added. If there is a pull-up resistor, its port is at a high level by default. You must use a low level to control it, such as the collector of the transistor in the three-state gate circuit, or the positive pole of the diode to control the current of the pull-up resistor to a low level. On the contrary, especially in the interface circuit, in order to obtain a certain level, this method is generally used to ensure the correct circuit state to avoid accidents. For example, in motor control, the upper and lower arms of the inverter bridge cannot be directly connected. If they are all driven by the same microcontroller, the initial state must be set. Prevent direct connection!

When selecting a resistor, choose the one that is closest to the standard value after calculation!
Why does P0 need a pull-up resistor? The reasons are:
1. There is no pull-up resistor in the P0 port chip
2. When P0 is in the I/O port working state, the upper FET is turned off, so the output pin is floating, so P0 is an open-drain output when used for the output line.
3. Since there is no pull-up resistor inside the chip and the upper FET is turned off, the port level cannot be pulled up when P0 outputs 1.
P0 is a bidirectional port, and the other P1, P2, and P3 are quasi-bidirectional ports. The quasi-bidirectional port is because it needs to be "prepared" before reading external data. Why is it necessary to prepare?
   When the microcontroller reads the port of the quasi-bidirectional port, it should first assign 1 to the port latch in order to turn off the FET so that the port will not be clamped at a low level due to the on-chip FET. The pull-
up and pull-down are generally 10k!

 

The most common use of the pull-up/pull-down resistor of the chip
    is that if there is a three-state gate with the next-level gate. If the output of the three-state is directly connected to the input of the next level, when the three-state gate is in a high-impedance state, the input of the next level will be like floating. It may cause logic errors and may be destructive to the MOS circuit. Therefore, using a resistor to pull the input of the next level up or down will not affect the logic and ensure that the input will not float.
    Change the potential of the level, often used in TTL-CMOS matching; There is a certain state when the pin is floating; Provide current for the output of the OC gate; As a termination resistor; It is equivalent to adding one more test point on the test board, especially for the board with more surface-mounted chips, so as to avoid cutting the line; Embedding; The pull-
    up and pull-down resistors have many functions, such as raising the peak-to-peak value of the signal, enhancing the signal transmission capability, preventing line reflection when the signal is transmitted over long distances, adjusting the signal level, etc.! Of course, there are other functions. The specific application method depends on the occasion and purpose. As for the parameters, they cannot be determined in general. They depend on other parameters of the circuit. For example, if the pull-up resistor usually used on the input pin is to increase the peak value, the resistance value should be determined by referring to the internal resistance of the pin! In addition, there is no saying that the input is added with pull-down and the output is added with pull-up. Sometimes, if there is no certain purpose, there may be both pull-up and pull-down resistors at the same time!

 

Add a ground resistor -- pull down
Add a power resistor -- pull up

 

For devices with open drain or open collector output, pull-up resistors are required to work. In addition, for ordinary ports, adding pull-up resistors can improve anti-interference ability, but it will increase the load.
Power supply: +5V
ordinary upright LED,

what size pull-up resistor is appropriate? Thank you for your advice!
    Generally, the current of LED is a few mA, and the maximum does not exceed 20mA. Based on this, you should be able to calculate the pull-up resistor value.
To be on the safe side, let it pull, (5-0.7)/10mA=400ohm, which is about right. If you are not sure, use 2k. [Strange, is there a new LED with a tube voltage of 0.7V? As far as I know, it seems to be around 1.5V. I think there is no big problem with a few hundred ohms to 1K. Generally, the chip will not be attenuated to 10mA, right? ]

   The role of the pull-down resistor: It is not seen much. It is commonly connected to the input end of a device and is mostly used for anti-interference. This is because the input end of a general IC is easily interfered when it is suspended, or there is a gap leakage voltage when the device is scanned, which affects the performance of the circuit. The latter has been encountered in a batch of devices.
    The resistance value of the pull-up resistor is mainly to take into account the low-level current absorption capability of the port. For example, at 5V voltage, adding a 1K pull-up resistor will increase the absorption current of the port in the low-level state by 5mA. Under the conditions that the port can withstand, it is better to have a smaller pull-up resistor.

Reference address:Use of pull-up and pull-down resistors

Previous article:The difference between TTL level and CMOS level
Next article:MSP430--Timer B

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号