AVR MCU Reset Introduction

Publisher:SerendipityJoyLatest update time:2013-01-14 Source: 21IC Keywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:AVR Reference address:AVR MCU Reset Introduction

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

AVR Lesson 11: How to treat our microcontroller
After learning MCS51 MCU, AVR MCU, PIC MCU, or MSP430 MCU, do you feel that you can become an engineer? Let me share my opinion here. When we learn these single-chip microcomputers, we first learn theoretical knowledge, which is generally theoretical knowledge from books, such as the introduction of the development
[Microcontroller]
Accurate software delay method in IAR FOR AVR
Note: __delay_cycles(x), x must be a constant or a constant expression. If it is a variable, the compiler will report an error! Delay functions are often used when using microcontrollers, and 430 is no exception. Common forms are: void delay(unsigned int ms) { unsigned int i,j; for( i=0;i ms;i++) for(j=0;j 1141;j++
[Microcontroller]
Linglong AVR Program Example 5 Digital Tube 4-digit Display
Now we let the 4-digit digital tube display 4 digits, here we use the dynamic scanning method. Here is a point to note when writing this program: 1                                      The sequence of dynamic tracing. First, the data is sent to the segment selector, then the bit selector of the bit to be displayed i
[Microcontroller]
AVR microcontroller power management and sleep mode
Introduction: Sleep mode allows the application to shut down unused modules in the MCU, thereby reducing power consumption. AVR has different sleep modes, allowing users to implement tailoring according to their application requirements. /* Status Register SREG bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ITHSVNZC
[Microcontroller]
AVR Studio Debugging Quick Start
The following debugging methods are from AVR Studio 4. I have tried to translate them for accurate understanding. Please correct me if there are any inaccuracies: Auto Step Automatic execution It can repeat the instructions. If the current mode is source (i.e. C language window display mode), one instruction will
[Microcontroller]
AVR Studio Debugging Quick Start
Unveiling the AVR microcontroller high-performance portable instrument circuit - Circuit Diagram Daily Reading (75)
  With the development of computer technology and microelectronics technology, industrial instruments have gradually developed into intelligent instruments with microprocessor systems. Portable intelligent instruments are becoming more and more popular in today's life because of their convenience, easy operation, frie
[Microcontroller]
Unveiling the AVR microcontroller high-performance portable instrument circuit - Circuit Diagram Daily Reading (75)
C language programming of 18B20 temperature sensor and LCD display based on AVR microcontroller
******************************************************/ #include #include #define uchar unsigned char #define uint unsigned int #include "1602LCD_drive.h" //Include LCD driver software package #include "DS18B20_drive.h" //DS18B20 driver software package #define beep_0 (PORTD=PORTD&0xbf) //The buzzer on PD6 sou
[Microcontroller]
Application of Watchdog in 8XC552 Series MCU System
1 Introduction Philips' 8XC552 microcontroller is widely used in industrial control, DCS control and intelligent instruments due to its small size, powerful functions and low price. In the process of developing the intelligent power distribution monitor, although the author has taken corresponding anti-interfer
[Microcontroller]
Application of Watchdog in 8XC552 Series MCU System
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号