Atmel ATmega640/V-1280/V-1281/V-2560/V-2561/V 8-bit Atmel Microcontroller with 16/32/64KB In-System Programmable Flash DATASHEET Features High Performance, Low Power Atmel AVR 8-Bit Microcontroller Advanced RISC Architecture 135 Powerful Instructions Most Single Clock Cycle Execution 32 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16MHz On-Chip 2-cycle Multiplier High Endurance Non-volatile Memory Segments 64K/128K/256KBytes of In-System Self-Programmable Flash 4Kbytes EEPROM 8Kbytes Internal SRAM Write/Erase Cycles:10,000 Flash/100,000 EEPROM Data retention: 20 years at 85C/ 100 years at 25C Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation Programming Lock for Software Security Endurance: Up to 64Kbytes Optional External Memory Space Atmel QTouch library support Capacitive touch buttons, sliders and wheels QTouch and QMatrix acquisition Up to 64 sense channels JTAG (IEEE std. 1149.1 compliant) Interface 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 Peripheral Features Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode Four 16-bit Timer/Counter with Separate Prescaler, Compare- and Capture Mode Real Time Counter with Separate Oscillator Four 8-bit PWM Channels 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) Two/Four Programmable Serial USART (ATmega1281/2561, ATmega640/1280/2560) Master/Slave SPI Serial Interface Byte Oriented 2-wire Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Interrupt and Wake-up on Pin Change Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated Oscillator External and Internal Interrupt Sources 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) 100-lead TQFP, 100-ball CBGA (ATmega640/1280/2560) RoHS/Fully Green Temperature Range: -40 C to 85C Industrial Ultra-Low Power Consumption Active Mode: 1MHz, 1.8V: 500A Power-down Mode: 0.1A at 1.8V Speed Grade: ATmega640V/ATmega1280V/ATmega1281V: 0 - 4MHz 1.8V - 5.5V, 0 - 8MHz 2.7V - 5.5V ATmega2560V/ATmega2561V: 0 - 2MHz 1.8V - 5.5V, 0 - 8MHz 2.7V - 5.5V ATmega640/ATmega1280/ATmega1281: 0 - 8MHz 2.7V - 5.5V, 0 - 16MHz 4.5V - 5.5V ATmega2560/ATmega2561: 0 - 16MHz 4.5V - 5.5V 2549QAVR02/20141. Pin Configurations Figure 1-1. TQFP-pinout ATmega640/1280/2560 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 100 (OC0B) PG5 1 75 PA3 (AD3) (RXD0/PCINT8) PE0 2 74 PA4 (AD4) INDEX CORNER (TXD0) PE1 3 73 PA5 (AD5) (XCK0/AIN0) PE2 4 72 PA6 (AD6) (OC3A/AIN1) PE3 5 71 PA7 (AD7) (OC3B/INT4) PE4 6 70 PG2 (ALE) (OC3C/INT5) PE5 7 69 PJ6 (PCINT15) (T3/INT6) PE6 8 68 PJ5 (PCINT14) (CLKO/ICP3/INT7) PE7 9 67 PJ4 (PCINT13) VCC 10 66 PJ3 (PCINT12) GND 11 65 PJ2 (XCK3/PCINT11) (RXD2) PH0 12 64 PJ1 (TXD3/PCINT10) (TXD2) PH1 13 63 PJ0 (RXD3/PCINT9) (XCK2) PH2 14 62 GND (OC4A) PH3 15 61 VCC (OC4B) PH4 16 60 PC7 (A15) (OC4C) PH5 17 59 PC6 (A14) (OC2B) PH6 18 58 PC5 (A13) (SS/PCINT0) PB0 19 57 PC4 (A12) (SCK/PCINT1) PB1 20 56 PC3 (A11) (MOSI/PCINT2) PB2 21 55 PC2 (A10) (MISO/PCINT3) PB3 22 54 PC1 (A9) (OC2A/PCINT4) PB4 23 53 PC0 (A8) (OC1A/PCINT5) PB5 24 52 PG1 (RD) (OC1B/PCINT6) PB6 25 51 PG0 (WR) 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 ATmega640/V-1280/V-1281/V-2560/V-2561/V DATASHEET 2 2549QAVR02/2014 (OC0A/OC1C/PCINT7) PB7 AVCC (T4) PH7 GND AREF (TOSC2) PG3 (TOSC1) PG4 PF0 (ADC0) RESET PF1 (ADC1) VCC PF2 (ADC2) GND PF3 (ADC3) PF4 (ADC4/TCK) XTAL2 XTAL1 PF5 (ADC5/TMS) (ICP4) PL0 PF6 (ADC6/TDO) (ICP5) PL1 PF7 (ADC7/TDI) (T5) PL2 PK0 (ADC8/PCINT16) PK1 (ADC9/PCINT17) (OC5A) PL3 (OC5B) PL4 PK2 (ADC10/PCINT18) (OC5C) PL5 PK3 (ADC11/PCINT19) PL6 PK4 (ADC12/PCINT20) PL7 PK5 (ADC13/PCINT21) PK6 (ADC14/PCINT22) (SCL/INT0) PD0 PK7 (ADC15/PCINT23) (SDA/INT1) PD1 GND (RXD1/INT2) PD2 (TXD1/INT3) PD3 VCC (ICP1) PD4 PJ7 (XCK1) PD5 PA0 (AD0) (T1) PD6 PA1 (AD1) (T0) PD7 PA2 (AD2)