AVR microcontroller working status

Publisher:数字思维Latest update time:2016-01-20 Source: eefocusKeywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  When the Vcc of the AVR chip is connected to the system power supply, the microcontroller will enter

  different states according to the different levels of the RESET pin: reset state, normal working state, and programming state.

  1. The RESET pin level is high

  Normally, the RESET pin is connected to the system power supply through a pull-up resistor and is high level "1", see Figure 2-13. Under

  this condition, once the power is turned on, the AVR will enter the power-on reset state. After a short internal reset operation, the chip

  enters the normal working state (the reset caused by BOD and WDT is similar).

  When the AVR is in the normal working state, there are two working modes: normal program execution working mode and sleep power saving working mode

  .

  z Normal program execution working mode

  The normal program execution working mode is the basic working mode of the microcontroller. Since the hardware reset operation sets the program counter

  to zero (PC=$0000), the execution of the program always starts from the Flash address $0000 (referring to non-BOOT LOAD mode

  startup).

  Sleep power saving mode

  The sleep power saving mode is a mode that puts the microcontroller in low power consumption and power saving. When the microcontroller needs to

  wait for an external trigger signal for a long time, and only performs corresponding processing after an external trigger, or only needs to perform processing at regular intervals

  , the sleep power saving mode can be used to reduce power consumption. When the CPU is waiting (standby state)

  , it can enter the sleep power saving mode. At this time, the CPU suspends work and does not execute any instructions. In the sleep power saving mode,

  only part of the microcontroller's circuits are in working state, while other circuits stop working, which can save the microcontroller's power

  consumption and form a power-saving standby state for the system. Once there is an external trigger signal or the waiting time is up, the CPU

  is awakened from the sleep state and re-enters the normal program execution mode.

  2 RESET pin level is low

  After the AVR is powered on, if the level of the RESET pin is pulled low by the outside to "0", the chip will enter and be in the reset state

  , see Figure 2-16 and Figure 2-17. Normally, this reset state continues until the low level of the RESET pin is cancelled.

  Once RESET returns to a high level, the AVR will restart and enter the normal working state. This feature can be used to implement

  manual reset or external forced reset operation of the AVR system.

  In particular, it should be noted that once the level of the RESET pin is pulled low by the outside, when certain special conditions are met, the chip will

  enter the programming state. For example, if the chip has an SPI interface and supports SPI serial programming, the following methods will make the chip

  enter the SPI programming state: z Pull down the SCK pin of the SPI port externally, and then apply   a low-level pulse

  of at least 2 system cycles to the RESET pin externally ;   z After a delay of 20ms, the external SPI programming instruction is sent to the chip through the SPI port of the AVR;   In the Serial   Downloading section of the Memory Programming chapter of the AVR device manual, the hardware connection of ISP programming using the SPI interface of the AVR, the   process of entering the programming mode state, and the commands of serial programming are specifically introduced.   Once the chip enters the programming state, the running code can be written into the program memory of the AVR through the SPI port,   the Flash and EEPROM in the chip can be erased, data can be written (including running code), and data can be read out, and the setting of the AVR   configuration fuse bit, the reading of the chip model, and the locking of the encryption bit can be realized.

















Keywords:AVR Reference address:AVR microcontroller working status

Previous article:ATMEGA16 controls 74LS164 to drive digital tube display
Next article:AVR microcontroller power failure detection function

Latest Microcontroller Articles
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号