In the use of microcontrollers, we often come into contact with the reset circuit, which is an important component of the smallest system of microcontrollers. It is also a very important part.
Reset is to make the microcontroller run again from the initialization state, that is, the program is executed from the beginning. The quality of the reset circuit design directly affects whether the entire system is stable and reliable. The reset circuit is connected to the RESET/NRST pin of the microcontroller. Taking the STM32 series microcontroller as an example, when the system is working normally, if the RESET pin voltage is lower than a certain threshold, the microcontroller enters the reset state. The reset of the microcontroller can be divided into low-level reset and high-level reset. This is determined by the manufacturer. You can see the data manual for the distinction. The reset chapter in the manual will clearly state what level reset is. The reset of the microcontroller can be divided into: power-on reset, power-off reset, software reset, external manual reset, etc. Power-on reset: Each time the microcontroller is powered on, it will give a reset signal to the RESET pin, allowing the microcontroller to restart working from the same fixed state; Power-down reset: When the reset pin voltage of the microcontroller is lower than a certain threshold potential, the microcontroller enters the reset state. Software reset: The programmer executes a specific reset instruction to reset the microcontroller, or controls the microcontroller to reset through a watchdog circuit when the program loses response for a certain period of time. External manual reset can re-run a crashed or runaway program through a reset button. Let's take a look at several common reset circuits. Figure 1 Figure 1 is the most common low-level power-on reset schematic diagram. Let's analyze this process. The voltage across the capacitor is 0 before power-on. After powering on, the current flows from 3.3V through the resistor and capacitor to ground. Since the voltage at both ends of the capacitor cannot change suddenly, the voltage on the RESET pin is also zero at the moment of powering on and remains low for a short period of time. During this period, the microcontroller is triggered. Reset; as time goes by, the voltage across the capacitor is too high to exceed a certain threshold potential, and the reset is completed. The value of this resistor and capacitor affects the rise time of the reset pin level (the charging time of the capacitor). figure 2 Figure 2 Schematic diagram of manual button reset. A button is connected between GND and RESET for manual button reset. When the button is pressed manually, the RESET pin will be pulled low by GND, causing the microcontroller to enter the reset state. If the hand is not released, it will remain in the reset state until the reset pin level is restored. The reset waveform inside the ST microcontroller. When powering on, VDD is greater than Vpor and lasts for a certain period of time. The microcontroller leaves the reset state. When powering off, the Vdd voltage is lower than the Vpdr voltage, and the microcontroller resets. There are two types of software reset. We can use the reset command to directly reset the microcontroller. The other is to use the built-in watchdog of the microcontroller, configure the startup watchdog, and refresh the watchdog at certain intervals in the main loop program. Commonly known as feeding the dog. If the dog is not fed for a certain period of time, it can be considered that the program has run away, and the watchdog module will reset the microcontroller. The built-in watchdog is divided into window watchdog and independent watchdog. The differences are as follows: Different clocks 1. Independent watchdog: The independent watchdog uses an internal dedicated 40Khz low-speed clock and does not need to enable clock operation. 2. Window watchdog: The window watchdog uses the clock of PCLK1, and the clock needs to be enabled before use. Different interrupts 1. Independent watchdog: The independent watchdog has no interrupt and is directly reset when timeout occurs. 2. Window watchdog: The window watchdog can perform function operations before resetting during interrupts, such as reporting some data errors, etc. Different usage scenarios 1. Independent watchdog: Independent watchdog is generally used to avoid program runaway or infinite loop. 2. Window watchdog: The window watchdog prevents the program from not executing according to the predetermined logic, such as completing before the ideal environment or timing out after the limit time. Of course, the circuit forms derived from reset may be more than the above two, but they are basically transformed around the above circuit. Finally, I emphasize that the shorter the RESET trace, the better. The reset circuit must be as close as possible to the MCU, because the reset The wiring from the circuit to the microcontroller may introduce interference from other external factors, causing the microcontroller to be in an unstable state. The content about reset is shared with you here. Have you ever encountered some problems caused by reset?
Previous article:Detailed explanation of the function and design of the microcontroller reset circuit
Next article:Solution to the problem of under-voltage reset of single-chip microcomputer
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Best RP2040 Development Boards of 2021
- Working principle of electronic tags
- Sell some idle SSDs Samsung 850 and 860evo
- 50Ω
- TI's Buck Converter Selection Reference Guide
- stm8
- Grab and run! EPOS implementation in unmanned retail stores
- EEWORLD University Hall----Introduction to Isolation Topology
- I would like to ask why this compensation circuit can achieve advance compensation.
- Please recommend a single chip analog to PWM solution