Pull-up and pull-down resistors on MCU

Publisher:数据梦行者Latest update time:2016-12-24 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

It seems that we have mentioned pull-up resistors and pull-down resistors many times before. What kind of resistors are considered pull-up resistors and what are the functions of pull-up resistors? A

pull-up resistor pulls an uncertain signal to a high level through a resistor, and this resistor also plays a current limiting role. A pull-down resistor pulls the signal to a low level.

For example, when our IO is set to open-drain output high level or high-impedance state, the default level is uncertain. The external pin is connected to VCC through a resistor, which is a pull-up resistor, and the corresponding pin is a high level; through a resistor to GND, which is a pull-down resistor, the corresponding pin is a low level.

Pull-up resistors have many applications, what functions can they play? Now we mainly understand the following 4 most commonly used points:

  1. In order for the OC gate to output a high level, an external pull-up resistor must be added for normal use. In fact, the OC gate is equivalent to the open-drain output of the microcontroller IO. The principle can be seen in the open-drain circuit in Figure 9-1.

  2. Increase the driving capacity of ordinary IO ports. The pull-up resistor of the internal IO port of the standard 51 MCU is generally tens of K ohms. For example, the internal pull-up resistor of STC89C52 is 20K, so the maximum output current is 250uA. Therefore, adding an external pull-up resistor can form a parallel structure with the internal pull-up resistor to increase the current output capacity at high level.

  3. In level conversion circuits, such as the 5V to 12V circuit we talked about earlier, the pull-up resistor actually plays the role of a current limiting resistor. You can review Figure 3-8.

  4. Unused pins in the microcontroller, such as bus pins, are susceptible to electromagnetic interference and are in a disordered state when the pins are left floating. Although it will not cause any impact on the program, it will usually increase the power consumption of the microcontroller. Adding a pull-up resistor to VCC or a pull-down resistor to GND can effectively resist electromagnetic interference.


So when we design the circuit, how do we choose the appropriate resistance value of the pull-up and pull-down resistors?

  1. It should be large enough to reduce power consumption, because the larger the resistance, the smaller the current.

  2. In order to ensure sufficient pin driving capability, it should be small enough. The smaller the resistance, the larger the current.

  3. In open-drain output, a pull-up resistor that is too large will cause the signal rising edge to slow down. Let us explain: the actual level change takes time. Although it is very small, it will never reach zero. The size of the pull-up resistor in open-drain output directly affects the time required for this rising process, as shown in Figure 9-2. Think about it, if the resistance is very large and the signal frequency is very fast, it will eventually cause the signal to become low before it rises to a high level, so the signal cannot be transmitted correctly.

Figure 9-2 Effect of pull-up resistor value on waveform
Figure 9-2 Effect of pull-up resistor value on waveform


Taking various situations into consideration, the pull-up and pull-down resistor values ​​we commonly use are mostly selected between 1K and 10K. The specific value usually depends on actual needs. Usually it is within the standard range and is not necessarily a fixed value.


Reference address:Pull-up and pull-down resistors on MCU

Previous article:Formal and actual parameters of C language functions
Next article:The address of a C language variable

Latest Microcontroller Articles
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号