When the AVR is reset, all I/O registers are set to their initial values and the program starts executing from the reset vector. The instruction at the reset vector must be an absolute jump JMP instruction so that the program jumps to the reset processing routine.
There are five reset signal sources for AVR:
Power-on reset: When the power supply voltage is lower than the power-on reset threshold VPOT, the MCU is reset.
External reset: When the low level on the RESET pin lasts longer than the minimum pulse width, the MCU is reset.
Watchdog reset. A reset occurs when the watchdog is enabled and the watchdog timer overflows.
Brownout detection reset: When the brownout detection reset function is enabled and the power supply voltage is lower than the brownout detection reset threshold VBOT, the MCU is reset.
JTAG AVR reset. MCU resets when the reset register is 1.
Power-On Reset
The power-on reset (POR) pulse is generated by the on-chip detection circuit. The POR circuit ensures that the device is reset at power-on. The delay counter is triggered after VCC reaches the power-on threshold voltage.
When VCC drops, the RESET signal takes effect immediately as long as it is below the detection threshold.
External reset
External reset is generated by a low level applied to the RESET pin. When the reset low level duration is greater than the minimum pulse width, the reset process is triggered, even if there is no clock signal running at this time. When the external signal reaches the reset threshold voltage VRST (rising edge), the tTOUT delay period begins. After the delay ends, the MCU starts.
Watchdog reset
When the watchdog timer overflows, a reset pulse with a duration of 1 CK cycle will be generated. At the falling edge of the pulse, the delay timer starts counting tTOUT.
Power-off detection reset
The switch of the BOD circuit is controlled by the fuse bit BODEN. When BOD is enabled (BODEN is programmed), once VCC drops below the trigger level (VBOT-, Figure 19), the BOD reset is immediately triggered. When VCC rises above the trigger level (VBOT+, Figure 19), the delay counter starts counting, and once the overflow time tTOUT is exceeded, the MCU resumes operation.
JTAG AVR Reset
JTAG resets the register mcur, and the MCU is reset when the reset register is 1. The JTAG reset register can be set by the JTAG instruction AVR_RESET, which triggers the MCU reset and sets JTRF. The power-on reset will clear it, and it can also be cleared by writing "0".
The MCU Control and Status Register provides information about the reset source that caused the MCU to reset.
The MCU Control and Status Register provides information about the reset source that caused the MCU to reset.
Bit 4 – JTRF: JTAG reset flag
The JTAG instruction AVR_RESET can set the JTAG reset register and trigger the MCU reset.
JTRF is set. A power-on reset will clear it, and it can also be cleared by writing a "0".
Bit 3 – WDRF: Watchdog reset flag
Set when a watchdog reset occurs. A power-on reset will clear it to 0, and it can also be cleared by writing "0".
Bit 2 – BORF: Brownout detection reset flag
Set when brownout detection reset occurs. Cleared by power-on reset and can be cleared by writing "0".
Bit 1 – EXTRF: External reset flag
Set when external reset occurs. Cleared by power-on reset and can be cleared by writing "0".
Bit 0 – PORF: Power-on reset flag
Set when a power-on reset occurs. Can only be cleared by writing "0".
To use these reset flags to identify a reset condition, the user should read the data of this register as early as possible and then reset it. If this register is reset before other resets occur, the source of subsequent resets can be known by checking the reset flags.
Previous article:AVR MCU ICC Quick Start
Next article:AVR basic hardware circuit design and analysis
Recommended ReadingLatest update time:2024-11-16 14:27
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- GD32E231 DIY Contest (2) GD32E231C Development Environment Getting Started DEMO Test
- [NXP Rapid IoT Review] A Bluetooth BLE communication app designed for NXP IoT in the third week
- Lithium-ion battery SOC state of charge measurement
- MSP430F5529 ADC analog-to-digital conversion source program
- Thank you for having you + you who helped me and myself who struggled
- The Dragon Boat Festival Chip Coin Exchange Event has begun! Zongzi, multimeter, Huawei router... are waiting for you!
- @PCB Engineer, here are some practical tips for Allegro drawing board
- TMS320F28335 generates SPWM
- What happens if the installation directory of keil5 is different from the installation directory of pack?
- I don't understand this speed, is it normal? The environment is esp8266