How the addresses work
Every device has its own set of I/O registers, so there is no table that holds for all AVRs: the viewer can name the registers of the five devices below and writes numbers for any other. The names and addresses are those of the
avr-libc device headers (iom328p.h, iom32u4.h, iomxx0_1.h for the ATmega640/1280/2560, iom32.h for the ATmega32, iotnx5.h for the ATtiny85), read online; the 16-bit pair names the headers add (ADC, TCNT1, ICR1 …) are left out and the low and high bytes (ADCL, ADCH) are named.
For all five devices the headers and the data sheets were saved as files and compared register by register by a test (see the section of each device).
A register of the I/O space (0x00 to 0x3F, reached by IN, OUT, SBI, CBI, SBIS, SBIC) is also in the data space at the address plus 0x20 (reached by LDS, STS, LD, ST). The registers above that exist in the data space only
(extended I/O, 0x60 and up). The viewer writes the name in both kinds of instruction. All numbers on this page are hexadecimal.
Registers that every device has: SPL 3D, SPH 3E, SREG 3F (I/O space).
Which names are checked. Each name carries one of two marks. V means the name and its address agree in the register summary of the manufacturer's data sheet and in a device header. I means name and address come from one source only (a header, read online) and have not been compared with a data sheet.
Per device: ATmega328P 87 of 87 names V; ATmega32U4 150 of 152 V (TIFR5 and EIND are I); ATmega2560 184 of 184 V; ATmega32 64 of 64 V; ATtiny85 52 of 52 V. Each device also agrees with the header and the ATDF description in Microchip's device pack. The viewers do not show the mark; this page does.
ATmega328P (Arduino Uno, Nano, Pro Mini)
All 87 names are V: compared with the register summary of the ATmega48A/PA/88A/PA/168A/PA/328/P data sheet (Microchip DS40002061B, section 36), avr-libc iom328p.h and common.h, and the device pack's iom328p.h and ATmega328P.atdf. No spelling differs.
I/O space (add 20 for the data address)
PINB 03 · DDRB 04 · PORTB 05 · PINC 06 · DDRC 07 · PORTC 08 · PIND 09 · DDRD 0A · PORTD 0B · TIFR0 15 · TIFR1 16 · TIFR2 17 · PCIFR 1B · EIFR 1C · EIMSK 1D · GPIOR0 1E · EECR 1F · EEDR 20 · EEARL 21 · EEARH 22 · GTCCR 23 · TCCR0A 24 · TCCR0B 25 · TCNT0 26 · OCR0A 27 · OCR0B 28 · GPIOR1 2A · GPIOR2 2B · SPCR 2C · SPSR 2D · SPDR 2E · ACSR 30 · SMCR 33 · MCUSR 34 · MCUCR 35 · SPMCSR 37
Extended I/O (data space only)
WDTCSR 60 · CLKPR 61 · PRR 64 · OSCCAL 66 · PCICR 68 · EICRA 69 · PCMSK0 6B · PCMSK1 6C · PCMSK2 6D · TIMSK0 6E · TIMSK1 6F · TIMSK2 70 · ADCL 78 · ADCH 79 · ADCSRA 7A · ADCSRB 7B · ADMUX 7C · DIDR0 7E · DIDR1 7F · TCCR1A 80 · TCCR1B 81 · TCCR1C 82 · TCNT1L 84 · TCNT1H 85 · ICR1L 86 · ICR1H 87 · OCR1AL 88 · OCR1AH 89 · OCR1BL 8A · OCR1BH 8B · TCCR2A B0 · TCCR2B B1 · TCNT2 B2 · OCR2A B3 · OCR2B B4 · ASSR B6 · TWBR B8 · TWSR B9 · TWAR BA · TWDR BB · TWCR BC · TWAMR BD · UCSR0A C0 · UCSR0B C1 · UCSR0C C2 · UBRR0L C4 · UBRR0H C5 · UDR0 C6
ATmega32U4 (Arduino Leonardo and Micro, Arduboy)
150 of 152 names are V: compared with the register summary of the ATmega16U4/32U4 data sheet (Atmel doc7766, section 31), avr-libc iom32u4.h and common.h, and the device pack's header and ATmega32U4.atdf. Two names are I: TIFR5 (both headers define it, but the data sheet row is Reserved and the ATDF has no such register) and EIND (headers and ATDF have it, the data sheet lists that address as Reserved). Spelling: TCNT4 and TC4H are the data sheet and ATDF names of 0xBE and 0xBF (the avr-libc header defines both as well: TCNT4 is the 16-bit word at 0xBE, with TCNT4L at 0xBE and TCNT4H as an alias of 0xBF, and TC4H at 0xBF); the data sheet row 0x31 reads OCDR/MONDR and the viewer writes OCDR.
I/O space (add 20 for the data address)
PINB 03 · DDRB 04 · PORTB 05 · PINC 06 · DDRC 07 · PORTC 08 · PIND 09 · DDRD 0A · PORTD 0B · PINE 0C · DDRE 0D · PORTE 0E · PINF 0F · DDRF 10 · PORTF 11 · TIFR0 15 · TIFR1 16 · TIFR3 18 · TIFR4 19 · TIFR5 1A · PCIFR 1B · EIFR 1C · EIMSK 1D · GPIOR0 1E · EECR 1F · EEDR 20 · EEARL 21 · EEARH 22 · GTCCR 23 · TCCR0A 24 · TCCR0B 25 · TCNT0 26 · OCR0A 27 · OCR0B 28 · PLLCSR 29 · GPIOR1 2A · GPIOR2 2B · SPCR 2C · SPSR 2D · SPDR 2E · ACSR 30 · OCDR 31 · PLLFRQ 32 · SMCR 33 · MCUSR 34 · MCUCR 35 · SPMCSR 37 · RAMPZ 3B · EIND 3C
Extended I/O (data space only)
WDTCSR 60 · CLKPR 61 · PRR0 64 · PRR1 65 · OSCCAL 66 · RCCTRL 67 · PCICR 68 · EICRA 69 · EICRB 6A · PCMSK0 6B · TIMSK0 6E · TIMSK1 6F · TIMSK3 71 · TIMSK4 72 · ADCL 78 · ADCH 79 · ADCSRA 7A · ADCSRB 7B · ADMUX 7C · DIDR2 7D · DIDR0 7E · DIDR1 7F · TCCR1A 80 · TCCR1B 81 · TCCR1C 82 · TCNT1L 84 · TCNT1H 85 · ICR1L 86 · ICR1H 87 · OCR1AL 88 · OCR1AH 89 · OCR1BL 8A · OCR1BH 8B · OCR1CL 8C · OCR1CH 8D · TCCR3A 90 · TCCR3B 91 · TCCR3C 92 · TCNT3L 94 · TCNT3H 95 · ICR3L 96 · ICR3H 97 · OCR3AL 98 · OCR3AH 99 · OCR3BL 9A · OCR3BH 9B · OCR3CL 9C · OCR3CH 9D · TWBR B8 · TWSR B9 · TWAR BA · TWDR BB · TWCR BC · TWAMR BD · TCNT4 BE · TC4H BF · TCCR4A C0 · TCCR4B C1 · TCCR4C C2 · TCCR4D C3 · TCCR4E C4 · CLKSEL0 C5 · CLKSEL1 C6 · CLKSTA C7 · UCSR1A C8 · UCSR1B C9 · UCSR1C CA · UCSR1D CB · UBRR1L CC · UBRR1H CD · UDR1 CE · OCR4A CF · OCR4B D0 · OCR4C D1 · OCR4D D2 · DT4 D4 · UHWCON D7 · USBCON D8 · USBSTA D9 · USBINT DA · UDCON E0 · UDINT E1 · UDIEN E2 · UDADDR E3 · UDFNUML E4 · UDFNUMH E5 · UDMFN E6 · UEINTX E8 · UENUM E9 · UERST EA · UECONX EB · UECFG0X EC · UECFG1X ED · UESTA0X EE · UESTA1X EF · UEIENX F0 · UEDATX F1 · UEBCLX F2 · UEBCHX F3 · UEINT F4
ATmega2560 (Arduino Mega 2560)
All 184 names are V: compared with the register summary of the ATmega640/1280/1281/2560/2561 data sheet (Atmel doc2549, section 33), avr-libc iom2560.h, iomxx0_1.h and common.h, and the device pack's iom2560.h and ATmega2560.atdf. The data sheet says OCDR at 0x31; iomxx0_1.h also has MONDR there.
I/O space (add 20 for the data address)
PINA 00 · DDRA 01 · PORTA 02 · PINB 03 · DDRB 04 · PORTB 05 · PINC 06 · DDRC 07 · PORTC 08 · PIND 09 · DDRD 0A · PORTD 0B · PINE 0C · DDRE 0D · PORTE 0E · PINF 0F · DDRF 10 · PORTF 11 · PING 12 · DDRG 13 · PORTG 14 · TIFR0 15 · TIFR1 16 · TIFR2 17 · TIFR3 18 · TIFR4 19 · TIFR5 1A · PCIFR 1B · EIFR 1C · EIMSK 1D · GPIOR0 1E · EECR 1F · EEDR 20 · EEARL 21 · EEARH 22 · GTCCR 23 · TCCR0A 24 · TCCR0B 25 · TCNT0 26 · OCR0A 27 · OCR0B 28 · GPIOR1 2A · GPIOR2 2B · SPCR 2C · SPSR 2D · SPDR 2E · ACSR 30 · OCDR 31 · SMCR 33 · MCUSR 34 · MCUCR 35 · SPMCSR 37 · RAMPZ 3B · EIND 3C
Extended I/O (data space only)
WDTCSR 60 · CLKPR 61 · PRR0 64 · PRR1 65 · OSCCAL 66 · PCICR 68 · EICRA 69 · EICRB 6A · PCMSK0 6B · PCMSK1 6C · PCMSK2 6D · TIMSK0 6E · TIMSK1 6F · TIMSK2 70 · TIMSK3 71 · TIMSK4 72 · TIMSK5 73 · XMCRA 74 · XMCRB 75 · ADCL 78 · ADCH 79 · ADCSRA 7A · ADCSRB 7B · ADMUX 7C · DIDR2 7D · DIDR0 7E · DIDR1 7F · TCCR1A 80 · TCCR1B 81 · TCCR1C 82 · TCNT1L 84 · TCNT1H 85 · ICR1L 86 · ICR1H 87 · OCR1AL 88 · OCR1AH 89 · OCR1BL 8A · OCR1BH 8B · OCR1CL 8C · OCR1CH 8D · TCCR3A 90 · TCCR3B 91 · TCCR3C 92 · TCNT3L 94 · TCNT3H 95 · ICR3L 96 · ICR3H 97 · OCR3AL 98 · OCR3AH 99 · OCR3BL 9A · OCR3BH 9B · OCR3CL 9C · OCR3CH 9D · TCCR4A A0 · TCCR4B A1 · TCCR4C A2 · TCNT4L A4 · TCNT4H A5 · ICR4L A6 · ICR4H A7 · OCR4AL A8 · OCR4AH A9 · OCR4BL AA · OCR4BH AB · OCR4CL AC · OCR4CH AD · TCCR2A B0 · TCCR2B B1 · TCNT2 B2 · OCR2A B3 · OCR2B B4 · ASSR B6 · TWBR B8 · TWSR B9 · TWAR BA · TWDR BB · TWCR BC · TWAMR BD · UCSR0A C0 · UCSR0B C1 · UCSR0C C2 · UBRR0L C4 · UBRR0H C5 · UDR0 C6 · UCSR1A C8 · UCSR1B C9 · UCSR1C CA · UBRR1L CC · UBRR1H CD · UDR1 CE · UCSR2A D0 · UCSR2B D1 · UCSR2C D2 · UBRR2L D4 · UBRR2H D5 · UDR2 D6 · PINH 100 · DDRH 101 · PORTH 102 · PINJ 103 · DDRJ 104 · PORTJ 105 · PINK 106 · DDRK 107 · PORTK 108 · PINL 109 · DDRL 10A · PORTL 10B · TCCR5A 120 · TCCR5B 121 · TCCR5C 122 · TCNT5L 124 · TCNT5H 125 · ICR5L 126 · ICR5H 127 · OCR5AL 128 · OCR5AH 129 · OCR5BL 12A · OCR5BH 12B · OCR5CL 12C · OCR5CH 12D · UCSR3A 130 · UCSR3B 131 · UCSR3C 132 · UBRR3L 134 · UBRR3H 135 · UDR3 136
ATmega32 and ATmega32A (UF2 family ATmega32)
All 64 names are V. The ATmega32 has no extended I/O: the data space above 0x5F is SRAM. Each address was compared with the register summary of the ATmega32A data sheet (Microchip DS40002072A, section 30) and of the original ATmega32 data sheet (Atmel doc2503), which are the same; with avr-libc iom32.h and common.h (for SPL, SPH and SREG); and with Microchip's ATmega device pack (iom32a.h and the ATmega32A.atdf description). The spelling is the data sheet's.
TWBR 00 · TWSR 01 · TWAR 02 · TWDR 03 · ADCL 04 · ADCH 05 · ADCSRA 06 · ADMUX 07 · ACSR 08 · UBRRL 09 · UCSRB 0A · UCSRA 0B · UDR 0C · SPCR 0D · SPSR 0E · SPDR 0F · PIND 10 · DDRD 11 · PORTD 12 · PINC 13 · DDRC 14 · PORTC 15 · PINB 16 · DDRB 17 · PORTB 18 · PINA 19 · DDRA 1A · PORTA 1B · EECR 1C · EEDR 1D · EEARL 1E · EEARH 1F · UBRRH 20 · WDTCR 21 · ASSR 22 · OCR2 23 · TCNT2 24 · TCCR2 25 · ICR1L 26 · ICR1H 27 · OCR1BL 28 · OCR1BH 29 · OCR1AL 2A · OCR1AH 2B · TCNT1L 2C · TCNT1H 2D · TCCR1B 2E · TCCR1A 2F · SFIOR 30 · OSCCAL 31 · TCNT0 32 · TCCR0 33 · MCUCSR 34 · MCUCR 35 · TWCR 36 · SPMCR 37 · TIFR 38 · TIMSK 39 · GIFR 3A · GICR 3B · OCR0 3C
Where two names share an address, the viewer writes one: 0x20 is UBRRH and UCSRC (bit 7 of the byte written selects which), 0x31 is OSCCAL and, with the OCDEN fuse programmed, OCDR. Two spellings of avr-libc's iom32.h are not used because the data sheet differs: MCUSR (the data sheet and the device pack say MCUCSR) and GIMSK (they say GICR).
ATtiny85
The ATtiny85 has no extended I/O: every register is in the I/O space (data address = I/O address + 20).
All 52 names are V: compared with the register summary of the ATtiny25/45/85 data sheet (Atmel doc2586, section 23), avr-libc iotn85.h, iotnx5.h and common.h, and the ATtiny device pack's iotn85.h and ATtiny85.atdf. Only the ATDF spells DTPS1 as DTPS.
ADCSRB 03 · ADCL 04 · ADCH 05 · ADCSRA 06 · ADMUX 07 · ACSR 08 · USICR 0D · USISR 0E · USIDR 0F · USIBR 10 · GPIOR0 11 · GPIOR1 12 · GPIOR2 13 · DIDR0 14 · PCMSK 15 · PINB 16 · DDRB 17 · PORTB 18 · EECR 1C · EEDR 1D · EEARL 1E · EEARH 1F · PRR 20 · WDTCR 21 · DWDR 22 · DTPS1 23 · DT1B 24 · DT1A 25 · CLKPR 26 · PLLCSR 27 · OCR0B 28 · OCR0A 29 · TCCR0A 2A · OCR1B 2B · GTCCR 2C · OCR1C 2D · OCR1A 2E · TCNT1 2F · TCCR1 30 · OSCCAL 31 · TCNT0 32 · TCCR0B 33 · MCUSR 34 · MCUCR 35 · SPMCSR 37 · TIFR 38 · TIMSK 39 · GIFR 3A · GIMSK 3B
Not described
- The bits inside the registers (names such as
PORTB5,TXEN0): the viewer does not name bits. - Every other device: ATmega8, 16, 128, 644, 1284, the XMEGA families, the newer tinyAVR 0/1/2 (their peripherals are laid out in a different way, in blocks) and the rest of the ATtiny line.
- Registers that a data sheet lists but the viewer does not name: none for these five devices (every named row of each register summary is in the table).