Capacitance Calculation of Single Chip Microcomputer Reset Circuit

Table of contents

1. Introduction to MCU reset circuit

1.1 Reset method

1.2 Reset level duration

1.3 Reset principle

2. Reset circuit capacitance calculation


This time, the reset circuit capacitance of the 51 single-chip microcomputer is calculated, and the calculation methods of other single-chip microcomputers are basically the same.

1. Introduction to MCU reset circuit

1.1 Reset method

Three reset methods of single chip microcomputer

1. High level reset

The working principle of the reset circuit is introduced in the book. To reset the 51 single-chip microcomputer, it only needs to connect a high level to the 9th pin for 2us, so how is this process realized? In the single-chip microcomputer system, the system resets once when the system is powered on, and the system resets again when the button is pressed. If it is released and then pressed, the system will also reset. Therefore, its reset can be controlled in the running system by opening and closing the key.

(1), power-on reset

The size of the capacitor is 10uf, and the size of the resistor is 10k. Therefore, according to the formula, it can be calculated that the capacitor is charged 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), and the time required is 10K*10UF=0.1S. That is to say, within 0.1S after the computer is started, the voltage across the capacitor increases between 0 and 3.5V. At this time, the voltage across the 10K resistor decreases from 5 to 1.5V (the sum of the voltages across the series circuit is the total voltage). So within 0.1S, the voltage received by the RST pin is 5V~1.5V. In the 51 single-chip microcomputer that works normally at 5V, the voltage signal less than 1.5V is a low-level signal, and the voltage signal greater than 1.5V is a high-level signal. Therefore, within 0.1S of starting up, the single-chip system automatically resets (the time for the high-level signal received by the RST pin is about 0.1S).

(2) Button reset

0.1S after the MCU starts, the voltage across the capacitor C continues to charge to 5V. At this time, the voltage across the 10K resistor is close to 0V, and the RST is at a low level, so the system works normally. When the button is pressed, the switch is turned on. At this time, a loop is formed at both ends of the capacitor, and the capacitor is short-circuited. Therefore, during the process of pressing the button, the capacitor starts to discharge the previously charged power. As time goes by, the voltage of the capacitor is released from 5V to 1.5V or even less within 0.1S. According to the voltage of the series circuit is the sum of all places, the voltage across the 10K resistor is 3.5V or even greater at this time, so the RST pin receives a high level again. The microcontroller system automatically resets.

Summary: 1. The principle of the reset circuit is that the RST pin of the microcontroller receives a level signal above 2US, as long as the charging and discharging time of the capacitor is greater than 2US, the reset can be realized, so the capacitance value in the circuit can be changed. 2. Press the button to reset the system, which is caused by the capacitor being in a short-circuit circuit, releasing all the electric energy and increasing the voltage across the resistor.

2. Low level reset

When using the STM32 chip, the commonly used reset method is button reset, and it is a low level reset. Its principle is opposite to the above-mentioned high-level reset, and the analysis is quite simple. I will not repeat it here, only the principle of button reset is given.

When the reset pin RST (full name RESET) of the single-chip microcomputer has a reset level of more than 2 machine cycles, the single-chip microcomputer performs a reset operation. If RST continues to be at the reset level, the microcontroller is in a cyclic reset state. When the single-chip microcomputer is in the normal level, it will normally transfer to the execution program.

When the single-chip microcomputer is powered on, the potential on both sides of the capacitor will be the same because the capacitor voltage cannot change suddenly. At this time, RST is at a low level. After that, the power supply charges the capacitor through the resistor as time goes by. When it is fully charged, RST is at a high level. Normal operation is high level, low level reset. That is, power-on low level, and then turn to high level. When the single-chip microcomputer is powered on, the potential on both sides of the capacitor will be the same because the capacitor voltage cannot change suddenly. At this time, RST is at a high level, and then the negative electrode of the power supply discharges the capacitor through the resistor as time goes by. When the discharge is complete, RST is at a low level. Normal operation is low level, high level reset.

There are five commonly used reset methods for 51 single-chip microcomputers:

1. Power-on brake reset, note: as long as the rise time of the power supply does not exceed 1ms, automatic power-on reset can be realized.

2. Software reset, note: the reset signal hold time is the time predetermined by the programmer.

3. Button level reset, note: the reset signal hold time is greater than 2 clock cycles.

4. External pulse reset, note: the reset signal hold time is greater than 2 clock cycles.

5. Watchdog overflow reset, note: the reset signal hold time is also the time scheduled by the programmer.

1.2 Reset level duration

Keeping the high level for more than two machine cycles can reset the MCU

For example: How long should the reset duration of the 51 single-chip microcomputer use the crystal oscillator frequency of 6mhz exceed? ? ?

Machine cycle = 12x clock cycle = 12x1/6 = 2us

Two machine cycles, ie 2x12x1/6=4us

1.3 Reset principle

0.1S after the MCU starts, the voltage across the capacitor C continues to charge to 5V. At this time, the voltage across the 10K resistor is close to 0V, and the RST is at a low level, so the system works normally. When the button is pressed, the switch is turned on. At this time, a loop is formed at both ends of the capacitor, and the capacitor is short-circuited. Therefore, during the process of pressing the button, the capacitor starts to discharge the previously charged power.

As time goes by, the voltage of the capacitor is released from 5V to 1.5V or even less within 0.1S. According to the voltage of the series circuit is the sum of all places, the voltage across the 10K resistor is 3.5V or even greater at this time, so the RST pin receives a high level again. The microcontroller system automatically resets.

2. Reset circuit capacitance calculation

(1), power-on reset

The size of the capacitor is 10uf, and the size of the resistor is 10k. Therefore, according to the formula, it can be calculated that the capacitor is charged 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), and the time required is 10K*10UF=0.1S. That is to say, within 0.1S after the computer is started, the voltage across the capacitor increases between 0 and 3.5V. At this time, the voltage across the 10K resistor decreases from 5 to 1.5V (the sum of the voltages across the series circuit is the total voltage). So within 0.1S, the voltage received by the RST pin is 5V~1.5V. In the 51 single-chip microcomputer that works normally at 5V, the voltage signal less than 1.5V is a low-level signal, and the voltage signal greater than 1.5V is a high-level signal. Therefore, within 0.1S of starting up, the single-chip system automatically resets (the time for the high-level signal received by the RST pin is about 0.1S).

(2) Button reset

0.1S after the MCU starts, the voltage across the capacitor C continues to charge to 5V. At this time, the voltage across the 10K resistor is close to 0V, and the RST is at a low level, so the system works normally. When the button is pressed, the switch is turned on. At this time, a loop is formed at both ends of the capacitor, and the capacitor is short-circuited. Therefore, during the process of pressing the button, the capacitor starts to discharge the previously charged power. As time goes by, the voltage of the capacitor is released from 5V to 1.5V or even less within 0.1S. According to the voltage of the series circuit is the sum of all places, the voltage across the 10K resistor is 3.5V or even greater at this time, so the RST pin receives a high level again. The microcontroller system automatically resets.

Summary: 1. The principle of the reset circuit is that the RST pin of the microcontroller receives a level signal above 2US, as long as the charging and discharging time of the capacitor is greater than 2US, the reset can be realized, so the capacitance value in the circuit can be changed. 2. Press the button to reset the system, which is caused by the capacitor being in a short-circuit circuit, releasing all the electric energy and increasing the voltage across the resistor.

Now suppose the output resistance of your microcontroller is RO, the power supply is VDD, and the resistance and capacitance of the reset circuit are R and C respectively.

The time constant is (RO+R)C

The formula is as follows, Vrst is the voltage on the capacitor

Now suppose the output resistance of your microcontroller is RO, the power supply is VDD, and the resistance and capacitance of the reset circuit are R and C respectively.

The time constant is (RO+R)C

The formula is as follows, Vrst is the voltage on the capacitor

 When the voltage of the 51 single-chip microcomputer is lower than 1.5V, it is low level, so it can start to reset when it is charged above 1.5V.

t=RC*ln(E/(E-Vt))=RC*ln(5/(5-1.5))=RC*1.25

Assumption: R takes 10K, t usually chooses 0.1S, then C=0.1/1.25/10K=8uf. Usually takes 10uf.

Guess you like

Origin blog.csdn.net/weixin_51248645/article/details/131020653