This is an old revision of the document!


Registers

Registers are a key element of AVR microcontrollers. There are various types of registers, including general-purpose, special-purpose, and status registers. General-purpose registers are used to store temporary data. Special registers control microcontroller functions, such as timers or ADC. Status registers store information about the processor state, such as carry or zero flags. Each register has a specific function and is accessible through particular assembler instructions. Registers allow quick access to data and control over the processor.

AVR CPU General Purpose Working Registers (R0-R31)

R0-R15: Basic general-purpose registers are used for various arithmetic and logical operations.

R16-R31: General-purpose registers that can be used with immediate

AVR Registers
Figure 1: AVR Registers

The X-register, Y-register, and Z-register: address pointers for indirect addressing R26-R31: These registers serve as 16-bit address pointers for indirect addressing of the data space. They are defined as X, Y, and Z registers.

Extended registers
Figure 2: Etended Registers

Other registers:

RAMPX, RAMPY, RAMPZ: Registers concatenated with the X-, Y-, and Z-registers, enabling indirect addressing of the entire data space on MCUs with more than 64 KB of data space, and constant data fetch on MCUs with more than 64 KB of program space.

RAMPD: Register concatenated with the Z-register, enabling direct addressing of the whole data space on MCUs with more than 64 KB data space.

EIND: Register concatenated with the Z-register, enabling indirect jump and call to the entire program space on MCUs with more than 64K words (128 KB) of program space.

Table 1: Register properties
Register Purpose Combined With Enables
RAMPX Extends data addressing X register Access to data above 64 KB using X
RAMPY Extends data addressing Y register Access to data above 64 KB using Y
RAMPZ Extends data and program addressing Z register Access to data and constants above 64 KB using Z
RAMPD Extends data addressing Z register Direct access to data above 64 KB
EIND Extends program addressing Z register Jumps and calls to program memory above 128 KB

All of the registers RAMPX, RAMPY, RAMPZ, RAMPD, and EIND are located in the extended I/O space of AVR microcontrollers. This area typically occupies addresses 0x3B–0x3F, although the exact address of each register depends on the specific AVR device. The precise locations can always be found in the Register Summary section of the device datasheet.

en/multiasm/piot/chapter_4_3.1768812766.txt.gz · Last modified: 2026/01/19 10:52 by marcin
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0