3281 views|1 replies

119

Posts

0

Resources
The OP
 

All useful information! Detailed explanation of the 51 single-chip microcomputer minimum system [Copy link]

The minimum microcontroller system , or the minimum application system, refers to a system in which a microcontroller can work using the least number of components .

For the 51 series single-chip microcomputers, the minimum system should generally include: single-chip microcomputer, crystal oscillator circuit, and reset circuit .

The following is a minimum system circuit diagram of a 51 single-chip microcomputer.

illustrate:

Reset circuit : It is composed of a capacitor in series with a resistor. From the figure and the property that "capacitor voltage cannot change suddenly", we can know that when the system is powered on, the RST pin will have a high level, and the duration of this high level is determined by the RC value of the circuit. A typical 51 microcontroller will reset when the high level of the RST pin lasts for more than two machine cycles, so a proper combination of RC values can ensure reliable reset. Generally, textbooks recommend that C take 10u and R take 8.2K. Of course, there are other methods. The principle is to allow the RC combination to produce a high level of no less than 2 machine cycles on the RST pin. As for how to calculate quantitatively, you can refer to books related to circuit analysis.

Crystal oscillator circuit : The typical crystal oscillator is 11.0592MHz (because it can accurately obtain 9600 baud rate and 19200 baud rate, used in occasions with serial communication)/12MHz (produce accurate uS level interruption, convenient timing operation)

MCU : an AT89S51/52 or other 51 series compatible MCU

Special attention : For pin 31 (EA/Vpp), when connected to a high level, the microcontroller starts to execute from 0000H of the internal ROM after reset; when connected to a low level, it starts to execute directly from 0000H of the external ROM after reset. This is something that beginners tend to overlook.

1. Reset circuit

Purpose of reset circuit

The reset circuit of the microcontroller is like the restart part of a computer. When the computer freezes during use, press the restart button and the program inside the computer will start from the beginning. The same is true for the microcontroller. When the microcontroller system is running and the program runs away due to environmental interference, press the reset button and the program inside will automatically start from the beginning.

The microcontroller reset circuit is as shown below:

Working Principle of Reset Circuit

It is introduced in the book that to reset the 51 single-chip microcomputer, it only needs to connect a high level to the 9th pin for 2US. How is this process achieved?

In a single-chip microcomputer system, the system is reset once when it is powered on, and the system is reset again when a key is pressed. If the key is released and then pressed again, the system will reset again. Therefore, the reset of the key can be controlled in a running system by opening and closing the key.

Why does it reset when I turn on the computer?

In the circuit diagram, the size of the capacitor is 10uF and the size of the resistor is 10k. So according to the formula, it can be calculated that the time required for the capacitor to charge to 0.7 times the power supply voltage (the power supply of the microcontroller is 5V, so charging to 0.7 times is 3.5V) is 10K*10UF=0.1S.

That is to say, within 0.1S of the computer startup , the voltage across the capacitor increases from 0 to 3.5V. At this time, the voltage across the 10K resistor decreases from 5 to 1.5V (the sum of the voltages at each point in the series circuit is the total voltage). Therefore, within 0.1S, the voltage received by the RST pin is 5V to 1.5V. In a 51 microcontroller that works normally at 5V, a voltage signal less than 1.5V is a low-level signal, and a voltage signal greater than 1.5V is a high-level signal. Therefore, within 0.1S of startup, the microcontroller system automatically resets (the high-level signal received by the RST pin is about 0.1S).

Why does it reset when the button is pressed?

0.1S after the microcontroller starts , the voltage across capacitor C is continuously charged to 5V. At this time, the voltage across the 10K resistor is close to 0V, and RST is at a low level, so the system works normally. When the button is pressed, the switch is turned on, and a loop is formed across the capacitor at this time. The capacitor is short-circuited, so during the process of pressing the button, the capacitor begins to release the previously charged electricity. As time goes by, the voltage of the capacitor is released from 5V to 1.5V or even smaller within 0.1S. According to the series circuit voltage being the sum of all points, the voltage across the 10K resistor is 3.5V or even larger at this time, so the RST pin receives a high level again. The microcontroller system automatically resets.

2. Summary

1. The principle of the reset circuit is that the RST pin of the microcontroller receives a level signal of more than 2US. As long as the charging and discharging time of the capacitor is greater than 2US, reset can be achieved, so the capacitance value in the circuit can be changed.

2. When the button is pressed, the system resets. This is because the capacitor is in a short circuit, releasing all the electrical energy, causing the voltage across the resistor to increase.

3. Introduction to the minimum system circuit of 51 single-chip microcomputer

( 1 ) The size of the polarity capacitor C1 of the 51 MCU minimum system reset circuit directly affects the reset time of the MCU. Generally, 10~30uF is used. The larger the minimum system capacitance of the 51 MCU, the shorter the reset time required.

( 2 ) The minimum system crystal oscillator Y1 of the 51 single-chip microcomputer can also use 6MHz or 11.0592MHz. Under normal working conditions, a higher frequency crystal oscillator can be used. The oscillation frequency of the minimum system crystal oscillator of the 51 single-chip microcomputer directly affects the processing speed of the single-chip microcomputer. The higher the frequency, the faster the processing speed.

( 3 ). The minimum system starting capacitors C2 and C3 of the 51 MCU are generally 15~33pF, and the closer the capacitor is to the crystal oscillator, the better, and the closer the crystal oscillator is to the MCU, the better. 4. The P0 port is an open-drain output. When used as an output port, a pull-up resistor must be added, and the resistance value is generally 10k.

When set to timer mode, the plus -1 counter counts the internal machine cycle (one machine cycle is equal to 12 oscillation cycles, that is, the counting frequency is 1/12 of the crystal frequency). The count value N multiplied by the machine cycle Tcy is the timing time t.

When set to counter mode, the external event count pulse is input to the counter from the T0 or T1 pin. The T0 and T1 pin levels are sampled during S5P2 of each machine cycle. When a high level input is sampled in a certain cycle and a low level is sampled in the next cycle, the counter is incremented by 1, and the updated count value is loaded into the counter during S3P1 of the next machine cycle. Since it takes 2 machine cycles to detect a falling edge from 1 to 0, the sampled level is required to be maintained for at least one machine cycle. When the crystal oscillator frequency is 12MHz, the maximum counting frequency does not exceed 1/2MHz, that is, the period of the counting pulse must be greater than 2 ms.

丨The article is organized to spread relevant technologies, the copyright belongs to the original author丨

丨If there is any infringement, please contact us to delete丨

This post is from MCU

Latest reply

.51 MCU minimum system oscillation capacitors C2 and C3 are generally 15~33pF This load capacitance is related to the parameters of the crystal and is not chosen randomly. However, generally, microcontrollers will not choose very good crystals. Many common crystals have a load capacitance of about 20pf.   Details Published on 2021-8-7 09:20
Personal signature

嵌入式、汇编语言等免费视频<

 

1w

Posts

25

Resources
2
 

.51 MCU minimum system oscillation capacitors C2 and C3 are generally 15~33pF

This load capacitance is related to the parameters of the crystal and is not chosen randomly. However, generally, microcontrollers will not choose very good crystals. Many common crystals have a load capacitance of about 20pf.

This post is from MCU
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list