Figure 3. Block diagram of the AVR architecture
To achieve the highest performance and parallelism, AVR uses Harvard architecture with independent data and program buses. Instructions in the program memory are run through a one-stage pipeline. The CPU reads the next instruction while executing one instruction (called prefetch in this article). This concept enables single-clock cycle execution of instructions. The program memory is FLASH that can be programmed online. The
fast access register file includes 32 8-bit general-purpose working registers with an access time of one clock cycle. This enables single-clock cycle ALU operation. In a typical ALU operation, two operands in the register file are accessed simultaneously, then the operation is performed, and the result is sent back to the register file. The entire process takes only one clock cycle. There are
6 registers in the register file that can be used as 3 16-bit indirect addressing register pointers to address the data space, achieving efficient address operations. One of the pointers can also be used as an address pointer for the program memory lookup table. These additional function registers are the 16-bit X, Y, and Z registers.
The ALU supports arithmetic and logical operations between registers and between registers and constants. The ALU can also perform single-register operations. After the operation is completed, the contents of the status register are updated to reflect the result of the operation.
Program flow is controlled by conditional/unconditional jump instructions and call instructions, which directly address the entire address space. Most instructions are 16 bits long, that is, each program memory address contains a 16-bit or 32-bit instruction. The
program memory space is divided into two areas: the boot area and the application area. Both areas have special lock bits to achieve read and read/write protection. The SPM instruction used to write to the application area must be located in the boot area. The
program counter (PC) of the return address during interrupts and subroutine calls is saved in the stack. The stack is located in the general data SRAM, so its depth is only limited by the size of the SRAM. In the reset routine, the user must first initialize the stack pointer SP. This pointer is located in the I/O space and can be read and written. The data SRAM can be accessed through 5 different addressing
modes .
The AVR memory space is a linear planar structure.
The AVR has a flexible interrupt module. The control register is located in the I/O space. The status register has a global interrupt enable bit. Each interrupt has an independent interrupt vector in the interrupt vector table. The priority of each interrupt is related to its position in the interrupt vector table. The lower the interrupt vector address, the higher the priority. The
I/O memory space contains 64 directly addressable addresses, which serve as control registers for CPU peripherals, SPI, and other I/O functions. Mapping to the data space is the address 0x20 - 0x5F after the register file.
Previous article:ATmega16 Status Register
Next article:ATmega16 Pin Functions
Recommended ReadingLatest update time:2024-11-16 15:29
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
- Sharing of wireless quality resources!
- Comparison of main control with storage chip SD NAND and eMMC
- There is a small thing in the water heater. If you don't pay attention, it can consume 1000 degrees of electricity in a month???
- Based on GD32E231 smart door lock
- CC2640R2F supports Alibaba Cloud Link IoT platform
- Factors to consider when selecting an electromagnetic flowmeter
- 【Practical】Eliminating EMI in Buck Converters (3)
- Optocoupler device selection
- Infineon Tmall flagship store is giving away gifts!
- Detailed explanation of digital filtering using single chip microcomputer