In the study, development and application of microcontrollers, the configuration of IO ports plays an important role in the realization of functions. The following introduces four common configurations. Now many microcontrollers have all four configurations to choose from.
1. Quasi-bidirectional port configuration
As shown in the figure below, when the IO output is high, its driving ability is very weak, and the external load can easily pull it to a low level. When the IO output is low, its driving ability is very strong and can absorb considerable current.
The quasi-bidirectional port has three pull-up transistors, one "very weak pull-up" that is turned on when the port latch is logic "1", and when the port is floating, the "very weak pull-up" pulls the port up to a high level.
The second pull-up transistor is a "weak pull-up" and is turned on when the port latch is logic "1" and the port itself is also "1". The current provided by this pull-up makes the quasi-bidirectional port output "1". If the port is
pulled to logic "0" by an external device at this time, the "weak pull-up" is controlled to be closed through the Schmitt trigger, while the "very weak pull-up" remains open. In order to pull this port low, the external device must have sufficient current sinking capability to
reduce the voltage on the pin below the threshold voltage.
The third pull-up transistor is a "strong pull-up". When the port latch jumps from "0" to "1", this pull-up is used to speed up the port's transition from logic "0" to logic "1".
When the quasi-bidirectional port is used as input, a Schmitt contactor and a NOT gate are used for interference and filtering.
When the quasi-bidirectional port is used as input, the button can be connected to the ground, as shown in Figure 1. Of course, R1 can also be removed and the button can be connected directly. When the button is closed, the port is pulled to a low level. When the button is released, the port is
pulled to a high level by the internal "very weak pull-up" transistor. When the port is used as an output, it should not be connected to the ground for external LEDs such as graphic control. In this way, the driving ability of the port is very weak, and the LED can only emit very weak light. If you want to drive the LED, you should use
the method in Figure 3. In this way, the quasi-bidirectional port can absorb 20mA of current when the output is low, so it can drive the LED. The method in Figure 4 is also acceptable, but when the LED is not emitting light, the port needs to absorb a large current.
2. Open-drain output configuration
This configuration turns off all pull-up transistors and only drives the pull-down transistors. The pull-down is the same as the quasi-bidirectional port pull-down configuration, so it can only output low level (absorb current) and high impedance state. It cannot output high level (output current). If it is to be used as a logic output, a pull-up resistor must be connected to VCC. This configuration can also be used to drive LEDs through Figures 3 and 4 above.
3. Push-pull output configuration
The pull-down of this configuration is the same as the quasi-bidirectional port and open-drain configuration, and has a strong current-sourcing capability. The difference is that it has a continuous strong pull-up. Therefore, the method in Figure 2 above can be used to drive the LED.
4. Input configuration only (high impedance configuration)
This configuration cannot output current or receive current and can only be used as input data.
The above four configurations each have their own characteristics and should be used flexibly according to their characteristics during use.
The biggest feature of the quasi-bidirectional port is that it can be used as both input and output without the need for control switching.
The characteristic of push-pull output is that it has a large driving ability regardless of the input high level or low level. When the input is high level, it can also directly light up the LED, which is not possible in the quasi-bidirectional port. This configuration is not suitable as an input because it requires the external device to have a strong current-drawing ability.
The characteristic of input-only configuration is that the port can only be used as input and can obtain very high input impedance. It is often used in ports with analog comparators or ADCs.
The open-drain output configuration is similar to the quasi-inverter output, but there is no internal pull-up resistor. It has good electrical compatibility. If you connect an external pull-up resistor to a 3V power supply, you can connect to a 3V logic device. If you connect an external pull-up resistor to a 5V power supply, you can connect to a 5V device.
It should be noted that the above four configurations can all be used as inputs, that is, they can all detect the logical state of the end, but their characteristics are different, and not every configuration can be directly connected to a button.
Previous article:Implementation of a power management driver design based on SEP0611
Next article:Single chip microcomputer controlled relay closing circuit diagram
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Development process of eCAN in DSP28335
- Sugar gliders Part ⑩ Sugar glider health monitoring system based on RSL10 - host computer design
- Can someone help me figure out whether this active filter is a voltage-controlled power supply type or a multiple feedback type?
- 【BearPi-HM Nano】NFC test
- One-touch multi-function button recognition technology
- Discussion: Top 10 SP Companies
- Frost has fallen~
- Ten empirical laws of electronic energy-saving lamps
- Summary by an expert: Answers to 23 classic questions in power supply development!
- What is the difference between these two ways of connecting the max680 capacitor?