Analysis on the selection of external pull-up resistors for AVR pins

Publisher:SerendipityJoyLatest update time:2011-11-04 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The I/O port of the AVR microcontroller is a bidirectional port. It has the following characteristics:

AVR IO has multiple IO modes:

1 High impedance state, mostly used for high impedance analog signal input, such as ADC digital-to-analog converter input, analog comparator input

2 Weak pull-up state (Rup=20K~50K), for input. Optimized for low-level signal input, eliminating the need for external pull-up resistors, such as key input, low-level interrupt trigger signal input

3. Push-pull strong output state, with extremely strong driving capability (>20mA), can directly drive LED, and the high and low driving capabilities are symmetrical.

In actual application, I used a 1M external pull-up to measure the pulse of the Hall device. It turned out that the pulse was measured even when there was no action. So I made the following measurements:

1. The pin is set as input, and the internal pull-up is disabled. Instead, an external 1M resistor is used to pull the pin up (PORTX is 0). The voltage of the pin is measured to be approximately 3.06 (the power supply voltage is 3.37).

2. The pin is set as input, and the internal pull-up is enabled (with an external pull-up resistor of 1M). The voltage of the pin is measured to be about 3.36 (the power supply voltage is 3.37).

3. The pin is set as input, and the internal pull-up is not enabled. Instead, an external adjustable resistor is used for pull-up (PORTX is 0). The pin voltage increases as the resistance of the external pull-up resistor decreases. When the value of the external adjustable resistor is about 40K, the pin voltage is close to the Vcc supply voltage, and the voltage no longer increases by reducing the resistance.

To sum up a rule, if an external pull-up resistor is used, the resistance should not exceed 40K, otherwise the voltage of the pin will not reach the voltage of Vcc.

correct:

The above measurement is problematic. The voltage measured in 1 is 3.06, which is due to the influence of the internal resistance of the multimeter. In other words, if the internal resistance of the multimeter is M level, the external 1M resistor is large enough compared to the multimeter, so there will be a relatively large voltage drop, resulting in a lower voltage on the pin (the actual voltage value of the pin should be close to the power supply voltage). The original system does not work because the external resistance is too large. What is the specific reason?

Reference address:Analysis on the selection of external pull-up resistors for AVR pins

Previous article:Design of lithium battery pack for electric vehicle based on single chip microcomputer control
Next article:Design and Analysis of AVR Basic Hardware Circuit

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号