The traditional 51 microcontroller IO interface can only be used as a standard bidirectional IO interface. If it is used to drive the LED, it can only be driven by current injection or by using a transistor external drive circuit.
Current injection method: the positive pole of the LED is connected to VCC, and the negative pole is connected to the IO port. When IO is high level, the two poles of the LED are at the same level, there is no current, and the LED is off; when IO is low level, the current flows from VCC to IO, and the LED lights up. However, when you connect the positive pole of the LED to the IO interface and the negative pole to GND, and set the IO interface to a high level, the LED will light up, but the brightness is not ideal because the IO interface has insufficient pull-up capability. You can use the following method to solve this problem.
Push-pull working mode: The positive and negative poles of the LED are connected to two IO ports respectively, and then the positive IO interface is set to push-pull output, and the negative IO interface is set to standard bidirectional current sink input. The push-pull mode has strong pull-up capability and can achieve high-level driving of LEDs.
Four ways to use IO ports
High impedance state is a common term in digital circuits, which refers to an output state of the circuit, which is neither a high level nor a low level. If the high impedance state is input into the next level circuit, it will have no effect on the next level circuit, just like not connected. If measured with a multimeter, it may be a high level or a low level, depending on what is connected to it.
When analyzing a circuit, the high impedance state can be understood as an open circuit. You can think of it as the output (input) resistance being very large. Its limit can be considered as floating.
1. In the structure of bus connection. There are multiple devices on the bus, and the devices are connected to the bus in the form of high impedance. In this way, the bus is automatically released when the device does not occupy the bus, so that other devices can obtain the right to use the bus.
2. Most microcontroller I/Os can be set to high-impedance input when used, such as Lingyang, AVR, etc. High-impedance input can be considered as an infinite input resistance, and it is considered that the I/O has little effect on the previous stage, and does not generate current (no attenuation), and to a certain extent, it also increases the chip's ability to resist voltage shocks.
Previous article:STC IAP chip simulation function
Next article:MCU software simulation SPI interface
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
- Serial port automatic transceiver chip
- Why does the amplitude of AD835 increase when the same frequency input is above 15M? How can I make the amplitude-frequency curve flatter?
- What do you plan to do during the National Day holiday?
- 【TGF4042 Signal Generator】+ Noise Test
- CAN communication design, please help
- Has anyone used ads7844?
- CPU card programming system main frequency setting
- EEWORLD University ---- Automotive eCall Power Solution
- Because he mastered the company's "core technology", the boss hired several strong men to kidnap people on the street after leaving the company
- It's time to test your eyesight