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?
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The STM8S003F3P6 chip is very interesting
- Serial port cannot be recognized
- The design is too exquisite, but the repair is too painful: iFixit releases a teardown report of AirPods 2, and the repairability score is zero
- 【Wireless closed-loop feedback system for desktop robotic arms】
- 8/21-22@Wuhan! Intel/World Peace Group invites you to participate in the Artificial Intelligence Technology Introduction and Implementation Seminar
- Professor Li Xia: How basic should basic research be?
- DSP Flash API Steps
- 【i.MX6ULL】Driver Development 11——LCD Driver Practice
- Microcontroller interview question collection
- HEF4051 is easy to damage