Principle of single chip microcomputer: reset circuit of AT89C52 single chip microcomputer[Copy link]
For AT89C52 to work, three circuits are essential, one is the clock circuit; the second is the reset circuit; the third is the power supply circuit. Today, I will take the STC89C52 microcontroller as an example to explain the clock circuit of the 51 microcontroller. Attached below is a schematic diagram of the STC89C52 microcontroller:
You can see the reset pin RST of the microcontroller. The 9th pin of the microcontroller is RST, which is the input port of the reset signal. The high level is valid. Under the condition that the clock oscillator is working stably, if the pin rises from low level to high level and lasts for 2 machine cycles (if the crystal frequency is 12MHz, the two machine cycles are 2us), the system will implement a reset operation. Let's interpret this sentence below. Now when we talk about the reset circuit, we first assume that under the premise of the stable operation of the clock oscillator, the RST pin should be changed from low level to high level and then the high level should last for more than 2us. The microcontroller starts to perform internal reset operation in the second machine cycle when RST is high level, and repeats the internal reset operation in each machine cycle before RST becomes low level. Until RST becomes a stable low level, the program starts to run from address 0000H. The reset circuit has manual reset and power-on automatic reset. The power-on automatic reset circuit is shown in the figure below.
If the microcontroller is powered on, the RST power-on automatic reset means that the microcontroller starts to perform the reset operation after 2 machine cycles of power-on, and stops the reset operation after power-off. As you can see, it is very troublesome to control the reset operation of the microcontroller by turning on and off the power each time. Powering on and off is troublesome in operation and easy to burn out the microcontroller. From the perspective of human-computer interaction, we do not use the automatic reset circuit. The following is a manual reset circuit, which is a more user-friendly circuit with a more ingenious design idea. It is truly a fascinating science. Here is the picture.
As you can see, I added a spring switch to the circuit. By pressing the spring switch, the circuit can be connected, and by releasing the spring switch, the circuit can be disconnected. This feature of the spring switch can perfectly solve the problems left over from the automatic reset circuit.