# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

ATMEL AVR Microcontroller ATmega2560 Data Sheet (1)(1)

Summary

Discover the robust and reliable features of this advanced 8-bit RISC microcontroller series. Ideal for embedded systems developers building IoT devices, control units, or custom electronics, these ultra-low power processors offer high performance in a compact package. This technical document provides exhaustive details on peripheral integration (ADC, PWM, Timers), memory architecture (Flash/EEPROM), and advanced communication protocols (USART, SPI, JTAG). It is the essential resource for engineers designing complex, efficient, and secure digital applications.

📄 Preview 📖 Table of Contents Contents PAGE OF 37

Page 1 Text Content

BDTIC www.bdtic.com/ATMEL

Features High Performance, Low Power AVR® 8-Bit Microcontroller Advanced RISC Architecture 135 Powerful Instructions – Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-Chip 2-cycle Multiplier High Endurance Non-volatile Memory Segments 64K/128K/256K Bytes of In-System Self-Programmable Flash 4K Bytes EEPROM 8K Bytes Internal SRAM

Write/Erase Cycles:10,000 Flash/100,000 EEPROM 8-bit

Data retention: 20 years at 85°C/ 100 years at 25°C Optional Boot Code Section with Independent Lock Bits Microcontroller In-System Programming by On-chip Boot Program True Read-While-Write Operation

Programming Lock for Software Security with

Endurance: Up to 64K Bytes Optional External Memory Space JTAG (IEEE std. 1149.1 compliant) Interface 64K/128K/256K Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support

Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface Bytes In-System

Peripheral Features Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode Programmable Four 16-bit Timer/Counter with Separate Prescaler, Compare- and Capture Mode Real Time Counter with Separate Oscillator

Four 8-bit PWM Channels Flash

Six/Twelve PWM Channels with Programmable Resolution from 2 to 16 Bits (ATmega1281/2561, ATmega640/1280/2560) Output Compare Modulator 8/16-channel, 10-bit ADC (ATmega1281/2561, ATmega640/1280/2560)

ATmega640/V

Two/Four Programmable Serial USART (ATmega1281/2561,ATmega640/1280/2560) Master/Slave SPI Serial Interface Byte Oriented 2-wire Serial Interface ATmega1280/V Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator

ATmega1281/V

Interrupt and Wake-up on Pin Change Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection ATmega2560/V Internal Calibrated Oscillator External and Internal Interrupt Sources

ATmega2561/V

Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and Extended Standby I/O and Packages 54/86 Programmable I/O Lines (ATmega1281/2561, ATmega640/1280/2560) 64-pad QFN/MLF, 64-lead TQFP (ATmega1281/2561)

Preliminary

100-lead TQFP, 100-ball CBGA (ATmega640/1280/2560) Ro HS/Fully Green Temperature Range: Summary -40°C to 85°C Industrial Ultra-Low Power Consumption Active Mode: 1 MHz, 1.8V: 500 µA Power-down Mode: 0.1 µA at 1.8V Speed Grade: ATmega640V/ATmega1280V/ATmega1281V: 0 - 4 MHz @ 1.8 - 5.5V, 0 - 8 MHz @ 2.7 - 5.5V ATmega2560V/ATmega2561V: 0 - 2 MHz @ 1.8 - 5.5V, 0 - 8 MHz @ 2.7 - 5.5V ATmega640/ATmega1280/ATmega1281: 0 - 8 MHz @ 2.7 - 5.5V, 0 - 16 MHz @ 4.5 - 5.5V ATmega2560/ATmega2561: 0 - 16 MHz @ 4.5 - 5.5V

Page Summary Contents For ATMEL AVR Microcontroller ATmega2560 Data Sheet (1)(1)

Page 1 BDTIC www.bdtic.com/ATMEL Features High Performance, Low Power AVR® 8-Bit Microcontroller Advanced RISC Architecture 135 Powerful Instructions – Most Single Clock Cycle Execution 32 x 8 General Purpos...
Page 2 1. Pin Configurations Figure 1-1. TQFP-pinout ATmega640/1280/2560 (OC0B) PG5 PA3 (AD3) (RXD0/PCINT8) PE0 PA4 (AD4) (TXD0) PE1 INDEX CORNER PA5 (AD5) (XCK0/AIN0) PE2 PA6 (AD6) (OC3A/AIN1) PE3 PA7 (AD7)...
Page 3 ATmega640/1280/1281/2560/2561 Figure 1-2. CBGA-pinout ATmega640/1280/2560 Top view Bottom view Table 1-1. CBGA-pinout ATmega640/1280/2560. GND AREF PF0 PF2 PF5 PK0 PK3 PK6 GND VCC AVCC PG5 PF1 PF3 PF6...
Page 4 Figure 1-3. Pinout ATmega1281/2561 (OC0B) PG5 PA3 (AD3) (RXD0/PCINT8/PDI) PE0 PA4 (AD4) INDEX CORNER (TXD0/PDO) PE1 PA5 (AD5) (XCK0/AIN0) PE2 PA6 (AD6) (OC3A/AIN1) PE3 PA7 (AD7) (OC3B/INT4) PE4 PG2 (A...
Page 5 ATmega640/1280/1281/2560/2561 2. Overview The ATmega640/1280/1281/2560/2561 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in...
Page 6 The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registe...
Page 7 ATmega640/1280/1281/2560/2561 2.2 Comparison Between ATmega1281/2561 and ATmega640/1280/2560 Each device in the ATmega640/1280/1281/2560/2561 family differs only in memory size and number of pins. Tab...
Page 8 resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port C also serves the functions of special features of the ATmega640/1...
Page 9 ATmega640/1280/1281/2560/2561 resistors are activated. The Port H pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port H also serves the functions of vario...
Page 10 2.3.17 AVCC AVCC is the supply voltage pin for Port F and the A/D Converter. It should be externally con- nected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC ...
Page 11 ATmega640/1280/1281/2560/2561 5. Register Summary Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page (0x1FF) Reserved Reserved (0x13F) Reserved (0x13E) Reserved (0x13D) Reserved (0x13C)...
Page 12 Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page (0x100) PINH PINH7 PINH6 PINH5 PINH4 PINH3 PINH2 PINH1 PINH0 (0x FF) Reserved (0x FE) Reserved (0x FD) Reserved (0x FC) Reserved (0x F...
Page 13 ATmega640/1280/1281/2560/2561 Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page (0x BE) Reserved (0x BD) TWAMR TWAM6 TWAM5 TWAM4 TWAM3 TWAM2 TWAM1 TWAM0 (0x BC) TWCR TWINT TWEA TWSTA T...
Page 14 Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page (0x7C) ADMUX REFS1 REFS0 ADLAR MUX4 MUX3 MUX2 MUX1 MUX0 (0x7B) ADCSRB ACME MUX5 ADTS2 ADTS1 ADTS0 page 272,291,,295 (0x7A) ADCSRA ADEN...
Page 15 ATmega640/1280/1281/2560/2561 Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page 0x1A (0x3A) TIFR5 ICF5 OCF5C OCF5B OCF5A TOV5 0x19 (0x39) TIFR4 ICF4 OCF4C OCF4B OCF4A TOV4 0x18 (0x38) ...
Page 16 6. Instruction Set Summary Mnemonics Operands Description Operation Flags #Clocks ARITHMETIC AND LOGIC INSTRUCTIONS ADD Rd, Rr Add two Registers Rd ← Rd + Rr Z,C,N,V,H ADC Rd, Rr Add with Carry two Re...
Page 17 ATmega640/1280/1281/2560/2561 Mnemonics Operands Description Operation Flags #Clocks BRVS Branch if Overflow Flag is Set if (V = 1) then PC ← PC + k + 1 None 1/2 BRVC Branch if Overflow Flag is Cleare...
Page 18 Mnemonics Operands Description Operation Flags #Clocks ELPM Rd, Z+ Extended Load Program Memory Rd ← (RAMPZ:Z), RAMPZ:Z ←RAMPZ:Z+1 None SPM Store Program Memory (Z) ← R1:R0 None IN Rd, P In Port Rd ← ...
Page 19 ATmega640/1280/1281/2560/2561 7. Ordering Information 7.1 ATmega640 Speed (MHz)(2) Power Supply Ordering Code Package(1)(3) Operation Range ATmega640V-8AU 100A 1.8 - 5.5V Industrial (-40°C to 85°C) AT...
Page 20 7.2 ATmega1281 Speed (MHz)(2) Power Supply Ordering Code Package(1)(3) Operation Range ATmega1281V-8AU 64A Industrial ATmega1281V-8MU 64M2 (-40°C to 85°C) ATmega1281-16AU 64A Industrial ATmega1281-16M...
Page 21 ATmega640/1280/1281/2560/2561 7.3 ATmega1280 Speed (MHz)(2) Power Supply Ordering Code Package(1)(3) Operation Range ATmega1280V-8AU 100A 1.8 - 5.5V Industrial (-40°C to 85°C) ATmega1280V-8CU 100C1 AT...
Page 22 7.4 ATmega2561 Speed (MHz)(2) Power Supply Ordering Code Package(1)(3) Operation Range ATmega2561V-8AU 64A Industrial ATmega2561V-8MU 64M2 (-40°C to 85°C) ATmega2561-16AU 64A Industrial ATmega2561-16M...
Page 23 ATmega640/1280/1281/2560/2561 7.5 ATmega2560 Speed (MHz)(2) Power Supply Ordering Code Package(1)(3) Operation Range ATmega2560V-8AU 100A 1.8 - 5.5V Industrial (-40°C to 85°C) ATmega2560V-8CU 100C1 AT...
Page 24 8. Packaging Information PIN 1 PIN 1 IDENTIFIER COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE D1 13.90 14.00 14.10 Note 2 Notes: 1. This package conforms to JEDEC reference MS-026, ...
Page 25 ATmega640/1280/1281/2560/2561 Marked A1 Identifier SIDE VIEW TOP VIEW A1 Corner 0.90 TYP 0.90 TYP COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE BOTTOM VIEW Øb 0.35 0.40 0.45 e 0.80 ...
Page 26 PIN 1 PIN 1 IDENTIFIER COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE D1 13.90 14.00 14.10 Note 2 Notes: E1 13.90 14.00 14.10 Note 2 1.This package conforms to JEDEC reference MS-026...
Page 27 ATmega640/1280/1281/2560/2561 Marked Pin# 1 ID SEATING PLANE TOP VIEW Pin #1 Corner SIDE VIEW Option A Pin #1 Triangle COMMON DIMENSIONS (Unit of Measure = mm) E2 SYMBOL MIN NOM MAX NOTE Option B Pin ...
Page 28 9. Errata 9.1 ATmega640 rev. A Inaccurate ADC conversion in differential mode with 200x gain High current consumption in sleep mode 1. Inaccurate ADC conversion in differential mode with 200x gain Wit...
Page 29 ATmega640/1280/1281/2560/2561 2. High current consumption in sleep mode. If a pending interrupt cannot wake the part up from the selected sleep mode, the current consumption will increase during sleep...
Page 30 Problem Fix/Workaround Do not use the part at voltages below 2.4 volts. 3. Incorrect ADC reading in differential mode The ADC has high noise in differential mode. It can give up to 7 LSB error. Proble...
Page 31 ATmega640/1280/1281/2560/2561 9.11 ATmega2561 rev. C High current consumption in sleep mode 1. High current consumption in sleep mode. If a pending interrupt cannot wake the part up from the selected ...
Page 32 2. Part does not work under 2.4 volts The part does not execute code correctly below 2.4 volts Problem Fix/Workaround Do not use the part at voltages below 2.4 volts. 3. Incorrect ADC reading in diffe...
Page 33 ATmega640/1280/1281/2560/2561 10. Datasheet Revision History Please note that the referring page numbers in this section are referring to this document.The referring revision in this section are refer...
Page 34 4. Updated “Device Identification Register” on page 304. 5. Updated “Signature Bytes” on page 340. 6. Updated “Instruction Set Summary” on page 419. 10.4 Rev. 2549I-07/06 1. Added “Data Retention” on ...
Page 35 ATmega640/1280/1281/2560/2561 10.8 Rev. 2549E-04/06 1. Updated “Features” on page 1. 2. Updated Table 12-1 on page 62. 3. Updated note for Table 12-1 on page 62. 4. Updated “Bit 6 – ACBG: Analog Compa...
Page 36 10.11 Rev. 2549B-05/05 1. JTAG ID/Signature for ATmega640 updated: 0x9608. 2. Updated Table 13-7 on page 81. 3. Updated “Serial Programming Instruction set” on page 354. 4. Updated “Errata” on page 28...
Page 37 Headquarters International Atmel Corporation Atmel Asia Atmel Europe Atmel Japan 2325 Orchard Parkway Room 1219 Le Krebs 9F, Tonetsu Shinkawa Bldg. San Jose, CA 95131 Chinachem Golden Plaza 8, Rue Jea...