Principle of single chip microcomputer reset circuit

Publisher:HarmonyJoyLatest update time:2013-06-08 Source: 21icKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Function of reset circuit

During the power-on or reset process, control the reset state of the CPU: keep the CPU in the reset state during this period, instead of working as soon as the power is turned on or the reset is completed, to prevent the CPU from issuing erroneous instructions and performing erroneous operations, and also to improve electromagnetic compatibility performance.

No matter what type of MCU the user uses, the design of the MCU reset circuit is always involved. The quality of the MCU reset circuit design directly affects the reliability of the entire system. Many users have encountered "freeze" and "program error" on site after designing the MCU system and successfully debugging it in the laboratory. This is mainly caused by the unreliable design of the MCU reset circuit.

Basic reset method

The microcontroller needs to be reset when it starts up, so that the CPU and various system components are in a certain initial state and start working from the initial state. The reset signal of the 89 series microcontroller is input from the RST pin to the Schmitt trigger in the chip. When the system is in normal working state and the oscillator is stable, if there is a high level on the RST pin and it lasts for more than 2 machine cycles (24 oscillation cycles), the CPU can respond and reset the system. The reset methods of the microcontroller system are: manual button reset and power-on reset

1. Manual button reset

Manual button reset requires a high level to be added to the reset input terminal RST (Figure 1). The general method is to connect a button between the RST terminal and the positive power supply Vcc. When the button is pressed manually, the +5V level of Vcc will be directly added to the RST terminal. The circuit of manual button reset is shown as follows. Since the button will remain connected for tens of milliseconds no matter how fast the human action is, it can fully meet the reset time requirement.

1.jpg

2. Power-on reset

The power-on reset circuit of AT89C51 is shown in Figure 2. Just connect a capacitor to the Vcc terminal on the RST reset input pin and a resistor to the ground. For CMOS microcontrollers, since there is a pull-down resistor inside the RST terminal, the external resistor can be removed and the external capacitor can be reduced to 1µF. The working process of power-on reset is that when power is applied, the reset circuit adds a short high-level signal to the RST terminal through the capacitor. This high-level signal gradually falls back as Vcc charges the capacitor, that is, the duration of the high level at the RST terminal depends on the charging time of the capacitor. In order to ensure that the system can be reset reliably, the high-level signal at the RST terminal must be maintained for a long enough time. When powered on, the rise time of Vcc is about 10ms, and the start-up time of the oscillator depends on the oscillation frequency. For example, if the crystal frequency is 10MHz, the start-up time is 1ms; if the crystal frequency is 1MHz, the start-up time is 10ms. In the reset circuit of Figure 2, when Vcc loses power, the voltage at the RST terminal will inevitably drop rapidly to below 0V. However, due to the limiting effect of the internal circuit, this negative voltage will not damage the device. In addition, during the reset period, the port pins are in a random state. After the reset, the system sets the ports to all "1" states. If the system does not get an effective reset when powered on, the program counter PC will not get a suitable initial value, so the CPU may start executing the program from an undefined position.

2.jpg[page]

3. Integral power-on reset

The commonly used power-on or switch reset circuit is shown in Figure 3. After power-on, due to the charging of capacitor C3 and the action of the inverting gate, RST remains at a high level for a period of time. When the microcontroller is already running, pressing and releasing the reset key K can also make RST a high level for a period of time, thereby realizing the power-on or switch reset operation.

Based on actual operating experience, the reference values ​​of capacitance and resistance of this reset circuit are given below.

In Figure 3: C: = 1uF, Rl = lk, R2 = 10k

3.jpg

Dedicated chip reset circuit:

The function of the power-on reset circuit in the control system is to start the microcontroller to work. However, when the power is turned on and the voltage is abnormal or disturbed during normal operation, the power supply will have some unstable factors, which may have a serious impact on the stability of the microcontroller. Therefore, a reset signal is output to the chip after a delay when the power is turned on. Another function of the reset circuit is to * the power supply voltage during normal operation. If the power supply is abnormal, a forced reset will be performed. The reset output pin needs to output a low level for three (12/fc s) or more instruction cycles, and the reset program starts to initialize the initial state inside the chip. Waiting for receiving input signals (such as signals from remote controls, etc.).

4.jpg

Analysis of the Principle of Power-On Reset Circuit

The 5V power supply is input through the 2nd pin of MC34064, and the 1st pin can output a rising edge to trigger the reset pin of the chip. The electrolytic capacitor C13 is used to adjust the reset delay time. When the power is turned off, the residual charge on the electrolytic capacitor C13 forms a loop through D13 and the internal circuit of MC34064, and the charge is released. It is ready for the next reset.

4. Key components of the power-on reset circuit

The key components are: MC34064.

5.jpg

6.jpg[page]

Transistor undervoltage reset circuit

欠压复位电路工作原理(图6)w 接通电源,+5V电压从“0V”开始上升,在升至3.6V之前,稳压二极管DH03都处于截止状态,QH01(PNP管)也处于截止状态,无复位电压输出。w 当+5V电源电压高于3.6V以后,稳压二极管DH03反向击穿,将其两端电压“箝位”于3.6V。当+5V电源电压高于4.3V以后,QH01开始导通,复位电压开始形成,当+5V电源电压接近+5V时,QH01已经饱和导通,复位电压达到稳定状态。

7.jpg

Watchdog reset circuit

The watchdog reset circuit mainly uses the CPU to reset the counter regularly when it is working normally, so that the value of the counter does not exceed a certain value; when the CPU cannot work normally, since the counter cannot be reset, its count will exceed a certain value, thereby generating a reset pulse, so that the CPU returns to normal working state. The typical application of the Watchdog reset circuit is shown in Figure 7. The reliability of this reset circuit mainly depends on the software design, that is, where the program that sends pulses to the reset circuit regularly is placed. Generally, this program is placed in the timer interrupt service subroutine. However, sometimes this design still causes the program to run away or work abnormally. The main reason is that when the program "runs away", after the timer is initialized and the interrupt is turned on, this "runaway" situation may not be corrected by the Watchdog reset circuit. Because the timer interrupt is really generated, even if the program is abnormal, the Watchdog can be reset normally. For this reason, a design method of adding a preset to the timer is proposed. That is, an address is pushed into the stack during initialization, and a statement of disabling interrupts and an infinite loop is executed at this address. All addresses not occupied by program code are replaced with the subroutine return instruction RET as much as possible. In this way, when the program runs away, the possibility of entering a trap will be greatly increased. Once the trap is entered, the timer stops working and turns off the interrupt, so that the watchdog reset circuit will generate a reset pulse to reset the CPU. Of course, this technology has certain difficulties in using it in real-time control or processing software.

8.jpg

Figure 7 Watchdog reset circuit

Comparator type reset circuit

The basic principle of the comparator reset circuit is shown in Figure 8. During power-on reset, since an RC low-pass network is formed, the voltage at the positive input of the comparator is delayed by a certain time compared to the negative input voltage. The time constant of the negative network of the comparator is much smaller than the time constant of the positive RC network. Therefore, when the positive voltage has not exceeded the negative voltage, the comparator outputs a low level and generates a high level after the inverter. The width of the reset pulse mainly depends on the speed of normal voltage rise. Since the time constant of the negative voltage discharge circuit is large, it is not sensitive to the fluctuation of the power supply voltage. However, the following two unfavorable phenomena are prone to occur: (1) When the interval of the secondary switch of the power supply is too short, the reset is unreliable; (2) When there is a surge in the power supply voltage, the reset pulse may not be generated after the surge disappears. For this reason, the comparator reset circuit will be improved, as shown in Figure 9. This improved circuit can eliminate the first phenomenon and reduce the occurrence of the second phenomenon. In order to completely eliminate these two phenomena, the digital logic method can be used in conjunction with the comparator to design the comparator reset circuit shown in Figure 9. This circuit can be used as a reset circuit for both power-on reset and watchdog reset circuit with a little improvement, which greatly improves the reliability of reset.

1.jpg

Figure 9 Improved comparator reset circuit

Keywords:MCU Reference address:Principle of single chip microcomputer reset circuit

Previous article:The role of pull-up resistor [picture and text]
Next article:MCU Programming Learning

Recommended ReadingLatest update time:2024-11-16 14:59

Design of boiler water treatment control device based on C8051F2xx series MCU chip
Natural water usually contains calcium and magnesium ions, commonly known as hard water. In boiler water, calcium and magnesium ions need to be removed from the water to form soft water to prevent boiler scaling. The softening treatment of boiler water is an important safety indicator in production. Therefore, the tec
[Microcontroller]
Design of boiler water treatment control device based on C8051F2xx series MCU chip
Comparison of MCU-based and ASIC-based LED thyristor dimming solutions
As a new and most potential light source, LED lighting is gaining more and more attention for its advantages of energy saving and environmental protection. Coupled with the policy encouragement of the national and local governments, my country's LED lighting industry has entered a stage of accelerated development, a
[Power Management]
Detailed explanation of on-chip resources and paging access mechanism of Freescale S12(X) series MCU
I have used Freescale S12(X) series microcontrollers before, but I didn’t have a deep understanding of the MCU’s on-chip memory resources and its paging access mechanism. Recently, the main chip of the project I was responsible for happened to be the MC9S12XS128 microcontroller, so I took this opportunity to study it
[Microcontroller]
Detailed explanation of on-chip resources and paging access mechanism of Freescale S12(X) series MCU
Serial port programming to achieve communication between MCU and PC
Now I want to use serial port programming to realize the communication between the microcontroller and the PC. Now there are some programming examples collected on the Internet for reference.  Serial port API communication function programming In 16-bit serial port applications, the 16-bit Windows API communica
[Microcontroller]
Performance characteristics and usage experience of single-chip microcomputers commonly used in making robots
Many friends who have just come into contact with robots or single-chip microcomputers are often confused by the wide variety of single-chip microcomputers. What are the differences between them? Which single-chip microcomputer is better for making robots? After we choose a single-chip microcomputer, what shortcuts can
[Microcontroller]
Performance characteristics and usage experience of single-chip microcomputers commonly used in making robots
51 MCU interrupt and serial communication integrated program
I am just starting to learn 51 interrupts, timers, serial ports, etc. I encountered many bottlenecks, such as how to send the value of the variable through the serial port (just add 0x30). I share this program with beginners. Function: 1. After power on, LED0 and LED1 flash twice at 0.5 second intervals, and the buz
[Microcontroller]
ST launches new series of STM32 ultra-low-power microcontrollers
STMicroelectronics (STMicroelectronics, NYSE: STM), a global semiconductor leader serving customers in multiple electronic applications, has released a new series of 32-bit general-purpose microcontrollers. The new series will significantly extend the battery life of consumer electronics, healthcare and industrial cont
[Microcontroller]
Parameter Analysis of Frequency Signal Measurement Using Single Chip Microcomputer
1. Introduction Regardless of the type of signal, continuous or discrete, regular or irregular, for a computer control system, it must first be conditioned through the forward channel so that the signal can be detected by the machine: the range of high and low levels, timing coordination, whether latching i
[Microcontroller]
Parameter Analysis of Frequency Signal Measurement Using Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号