The following introduces the circuit design of the single-chip microcomputer minimum system . The single-chip microcomputer minimum system is mainly composed of power supply, reset, oscillation circuit and expansion part. For a complete electronic design , the first problem is to provide a power supply module for the entire system. The stability and reliability of the power supply module is the premise and basis for the smooth operation of the system.
1. Power supply
When using the STC89C52RC microcontroller, the operating voltage is: 5.5V-3.4V (5V microcontroller). This means that the normal operating voltage of our microcontroller is a range value. As long as the power supply VCC is between 5.5V and 3.4V, it can work normally. Voltage exceeding 5.5V is absolutely not allowed, which will burn out the microcontroller. If the voltage is lower than 3.4V, the microcontroller will not be damaged, but it will not work normally.
2. Oscillation circuit
There are crystal oscillators in the microcontroller system. The crystal oscillator plays a very important role in the microcontroller system. The full name of the crystal oscillator is crystal oscillator. It combines with the internal circuit of the microcontroller to generate the clock frequency required by the microcontroller. The higher the clock frequency provided by the microcontroller crystal oscillator, the faster the microcontroller runs. The execution of all instructions connected to the chip is based on the clock frequency provided by the microcontroller crystal oscillator.
Crystal Oscillator
Crystal oscillators are usually divided into two types: passive crystal oscillators and active crystal oscillators. Passive crystal oscillators are generally called crystals, while active crystal oscillators are called oscillators.
The active crystal oscillator is a complete resonant oscillator. It uses the piezoelectric effect of a quartz crystal to start oscillating, so the active crystal oscillator needs power supply. When we make the active crystal oscillator circuit, it can actively generate an oscillation frequency without the need for an external circuit, and can provide a high-precision frequency reference. The signal quality is better than that of a passive signal.
Active crystal oscillators usually have 4 pins, VCC, GND, crystal output pin and an unused floating pin. Passive crystal oscillators have 2 or 3 pins. If it has 3 pins, the middle pin is the shell of the crystal oscillator, which needs to be connected to GND when in use. The pins on both sides are the two lead pins of the crystal. These two pins have the same function, just like the two pins of a resistor, there is no positive or negative difference. For passive crystal oscillators, just connect the two crystal oscillator pins on our microcontroller, while active crystal oscillators only need to be connected to the input pin of the crystal oscillator of the microcontroller, and the output pin does not need to be connected, as shown in Figures 1 and 2.
Figure 1 Passive crystal oscillator connection method
Figure 2 Active crystal oscillator connection method
3. Reset circuit
Let's first analyze our reset circuit, as shown in Figure 3.
Figure 3 MCU reset circuit
When the circuit is in steady state, the capacitor isolates the DC and +5V, and the reset button on the left is in the pop-up state, so there is no voltage difference in the lower part of the circuit, so the potential of the button and the part below the capacitor C11 is equal to GND, that is, 0V. Our microcontroller is reset at a high level and works normally at a low level, so the normal working voltage is 0V, which is completely OK.
4. Independent buttons
Common buttons are divided into two types: independent buttons and matrix buttons. Independent buttons are simpler and are connected to independent input lines, as shown in Figure 4.
Figure 4 Independent key circuit diagram
The 4 input lines are connected to the IO port of the microcontroller. When the button K1 is pressed, +5V passes through the resistor R1 and then through the button K1 to finally enter the GND to form a path. Then the entire voltage of this line is added to the resistor R1, and the KeyIn1 pin is a low level. When the button is released, the line is disconnected, and no current will pass through. Then KeyIn1 and +5V should be at the same potential, which is a high level. We can use the high and low levels of the KeyIn1 IO port to determine whether a button is pressed.
We know the principle of the button in this circuit, but in fact, there is also a pull-up resistor inside our microcontroller IO port. Our button is connected to the P2 port, which is a quasi-bidirectional IO port by default when powered on. Let's take a brief look at the circuit of this quasi-bidirectional IO port, as shown in Figure 5.
Figure 5 Quasi-bidirectional IO port structure diagram
When the internal output is high, it becomes low after an inverter, and the NPN transistor will not conduct. From the internal point of view, the IO port of the microcontroller is at a high level due to the pull-up resistor R. When no external key is pressed to pull the level down, VCC is also +5V. Although there are two resistors between them, there is no voltage difference, so there will be no current, and all positions on the line are at high levels. At this time, we can read the state of the key normally.
When the internal output is a low level, it becomes a high level after passing through an inverter, and the NPN transistor is turned on. Then the internal IO port of the microcontroller is a low level. At this time, although there is an external pull-up resistor, the two resistors are in parallel. Regardless of whether the button is pressed or not, the state of the IO port input to the microcontroller is a low level, and we cannot read the state of the button normally.
5. Matrix buttons
The relationship between matrix buttons and independent buttons
We have such an experience when using buttons. When multiple buttons are needed, if they are made into independent buttons, a large number of IO ports will be occupied. Therefore, we introduced matrix buttons, as shown in Figure 6, using 8 IO ports to implement 16 buttons.
Figure 6 Matrix buttons
In fact, if we understand independent keys, the matrix keys are also simple. Let's analyze them. In Figure 6, there are 4 groups of keys in total. We only look at one group, as shown in Figure 7. Everyone, take a closer look. When KeyOut1 outputs a low level, and KeyOut2, KeyOut3, and KeyOut4 output high levels, are they equivalent to 4 independent keys?
Figure 7 Matrix buttons become independent buttons
Editor's comment: This article introduces the circuit design of the single-chip microcomputer minimum system. The single-chip microcomputer system has a crystal oscillator, which is usually divided into two types: passive crystal oscillator and active crystal oscillator. The power module, reset circuit and oscillation circuit of the single-chip microcomputer minimum system are analyzed in detail. Understanding the design of the single-chip microcomputer minimum system is beneficial to engineers.
Previous article:51 MCU serial communication principle and application
Next article:A brief analysis of the selection and application of the pull-up resistor of the P0 port of the 51 single-chip microcomputer
Recommended ReadingLatest update time:2024-11-16 07:21
- Popular Resources
- Popular amplifiers
- EDA Technology Practical Tutorial--Verilog HDL Edition (Sixth Edition) (Pan Song, Huang Jiye)
- Detailed explanation of core technologies of new energy vehicles: battery pack BMS VCU MCU
- Learn to repair variable frequency air conditioner easily with zero basic knowledge (Zhang Yunkun and Zhang Xinde)
- Graphic inverter technical questions and answers
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
- [NXP Rapid IoT Review] + First login to NXP online programming
- About the segment screen shadow light and dark
- Apply for Vicor high-power modular DC-DC power supply for free!
- Is there any problem with this circuit?
- [Mil MYC-JX8MPQ review] + OpenCV library for compilation
- Read the book "Operational Amplifier Parameter Analysis and LTspice Application Simulation" 01 "LTspice IV Getting Started Guide" + Software Download
- How to read the ceramic capacitor
- MSP430 System-Level ESD Considerations
- What chip can achieve the three-in-one dimming function? 0-10V, PWM, 100K resistor.
- Find P89C54X2BN AD library