2549K–AVR–01/07Features�HighPerformance,LowPowerAVR®8-BitMicrocontroller�AdvancedRISCArchitecture–135PowerfulInstructions–MostSingleClockCycleExecution–32x8GeneralPurposeWorkingRegisters–FullyStaticOperation–Upto16MIPSThroughputat16MHz–On-Chip2-cycleMultiplier�Non-volatileProgramandDataMemories–64K/128K/256KBytesofIn-SystemSelf-ProgrammableFlashEndurance:10,000Write/EraseCycles–OptionalBootCodeSectionwithIndependentLockBitsIn-SystemProgrammingbyOn-chipBootProgramTrueRead-While-WriteOperation–4KBytesEEPROMEndurance:100,000Write/EraseCycles–8KBytesInternalSRAM–Upto64KBytesOptionalExternalMemorySpace–ProgrammingLockforSoftwareSecurity�JTAG(IEEEstd.1149.1compliant)Interface–Boundary-scanCapabilitiesAccordingtotheJTAGStandard–ExtensiveOn-chipDebugSupport–ProgrammingofFlash,EEPROM,Fuses,andLockBitsthroughtheJTAGInterface�PeripheralFeatures–Two8-bitTimer/CounterswithSeparatePrescalerandCompareMode–Four16-bitTimer/CounterwithSeparatePrescaler,Compare-andCaptureMode–RealTimeCounterwithSeparateOscillator–Four8-bitPWMChannels–Six/TwelvePWMChannelswithProgrammableResolutionfrom2to16Bits(ATmega1281/2561,ATmega640/1280/2560)–OutputCompareModulator–8/16-channel,10-bitADC(ATmega1281/2561,ATmega640/1280/2560)–Two/FourProgrammableSerialUSART(ATmega1281/2561,ATmega640/1280/2560)–Master/SlaveSPISerialInterface–ByteOriented2-wireSerialInterface–ProgrammableWatchdogTimerwithSeparateOn-chipOscillator–On-chipAnalogComparator–InterruptandWake-uponPinChange�SpecialMicrocontrollerFeatures–Power-onResetandProgrammableBrown-outDetection–InternalCalibratedOscillator–ExternalandInternalInterruptSources–SixSleepModes:Idle,ADCNoiseReduction,Power-save,Power-down,Standby,andExtendedStandby�I/OandPackages–54/86ProgrammableI/OLines(ATmega1281/2561,ATmega640/1280/2560)–64-padQFN/MLF,64-leadTQFP(ATmega1281/2561)–100-leadTQFP,100-ballCBGA(ATmega640/1280/2560)–RoHS/FullyGreen�TemperatureRange:–-40°Cto85°CIndustrial�Ultra-LowPowerConsumption–ActiveMode:1MHz,1.8V:510µA–Power-downMode:0.1µAat1.8V�SpeedGrade(see“Maximumspeedvs.VCC”onpage377):–ATmega640V/ATmega1280V/ATmega1281V:0-4MHz@1.8-5.5V,0-8MHz@2.7-5.5V–ATmega2560V/ATmega2561V:0-2MHz@1.8-5.5V,0-8MHz@2.7-5.5V–ATmega640/ATmega1280/ATmega1281:0-8MHz@2.7-5.5V,0-16MHz@4.5-5.5V–ATmega2560/ATmega2561:0-16MHz@4.5-5.5V8-bitMicrocontrollerwith64K/128K/256KBytesIn-SystemProgrammableFlashATmega640/VATmega1280/VATmega1281/VATmega2560/VATmega2561/VPreliminary2ATmega640/1280/1281/2560/25612549K–AVR–01/07PinConfigurationsFigure1.TQFP-pinoutATmega640/1280/2560GNDVCCPA0(AD0)PA1(AD1)PA2(AD2)PA3(AD3)PA4(AD4)PA5(AD5)PA6(AD6)PA7(AD7)PG2(ALE)AVCCGNDAREFPF0(ADC0)PF1(ADC1)PF2(ADC2)PF3(ADC3)PF4(ADC4/TCK)PF5(ADC5/TMS)PF6(ADC6/TDO)PF7(ADC7/TDI)ATmega640/1280/2560100999897969594939291908988878685848382818079787776123456789101112131415161718192021222324257574737271706968676665646362616059585756555453525126282931273630323537333438394041424344454647484950PK0(ADC8/PCINT16)PK1(ADC9/PCINT17)PK2(ADC10/PCINT18)PK3(ADC11/PCINT19)PK4(ADC12/PCINT20)PK5(ADC13/PCINT21)PK6(ADC14/PCINT22)PK7(ADC15/PCINT23)(OC2B)PH6(TOSC2)PG3(TOSC1)PG4RESET(T4)PH7(ICP4)PL0VCCGNDXTAL2XTAL1PL6PL7GNDVCC(OC0B)PG5VCCGND(RXD2)PH0(TXD2)PH1(XCK2)PH2(OC4A)PH3(OC4B)PH4(OC4C)PH5(RXD0/PCINT8)PE0(TXD0)PE1(XCK0/AIN0)PE2(OC3A/AIN1)PE3(OC3B/INT4)PE4(OC3C/INT5)PE5(T3/INT6)PE6(CLKO/ICP3/INT7)PE7(SS/PCINT0)PB0(SCK/PCINT1)PB1(MOSI/PCINT2)PB2(MISO/PCINT3)PB3(OC2A/PCINT4)PB4(OC1A/PCINT5)PB5(OC1B/PCINT6)PB6(OC0A/OC1C/PCINT7)PB7PC7(A15)PC6(A14)PC5(A13)PC4(A12)PC3(A11)PC2(A10)PC1(A9)PC0(A8)PG1(RD)PG0(WR)(TXD1/INT3)PD3(ICP1)PD4(XCK1)PD5(T1)PD6(T0)PD7(SCL/INT0)PD0(SDA/INT1)PD1(RXD1/INT2)PD2(ICP5)PL1(T5)PL2(OC5A)PL3(OC5B)PL4PJ6(PCINT15)PJ5(PCINT14)PJ4(PCINT13)PJ3(PCINT12)PJ2(XCK3/PCINT11)PJ1(TXD3/PCINT10)PJ0(RXD3/PCINT9)PJ7(OC5C)PL5INDEXCORNER3ATmega640/1280/1281/2560/25612549K–AVR–01/07Figure2.CBGA-pinoutATmega640/1280/2560Table1.CBGA-pinoutATmega640/1280/2560.12345678910AGNDAREFPF0PF2PF5PK0PK3PK6GNDVCCBAVCCPG5PF1PF3PF6PK1PK4PK7PA0PA2CPE2PE0PE1PF4PF7PK2PK5PJ7PA1PA3DPE3PE4PE5PE6PH2PA4PA5PA6PA7PG2EPE7PH0PH1PH3PH5PJ6PJ5PJ4PJ3PJ2FVCCPH4PH6PB0PL4PD1PJ1PJ0PC7GNDGGNDPB1PB2PB5PL2PD0PD5PC5PC6VCCHPB3PB4RESETPL1PL3PL7PD4PC4PC3PC2JPH7PG3PB6PL0XTAL2PL6PD3PC1PC0PG1KPB7PG4VCCGNDXTAL1PL5PD2PD6PD7PG0ABCDEFGHJK12345678910ABCDEFGHJK10987654321TopviewBottomview4ATmega640/1280/1281/2560/25612549K–AVR–01/07Figure3.PinoutATmega1281/2561Note:ThelargecenterpadunderneaththeQFN/MLFpackageismadeofmetalandinternallyconnectedtoGND.Itshouldbesolderedorgluedtotheboardtoensuregoodmechani-calstability.Ifthecenterpadisleftunconnected,thepackagemightloosenfromtheboard.DisclaimerTypicalvaluescontainedinthisdatasheetarebasedonsimulationsandcharacteriza-tionofotherAVRmicrocontrollersmanufacturedonthesameprocesstechnology.Min.andMaxvalueswillbeavailableafterthedeviceischaracterized.ATmega1281/2561(RXD0/PCINT8/PDI)PE0(TXD0/PDO)PE1(XCK0/AIN0)PE2(OC3A/AIN1)PE3(OC3B/INT4)PE4(OC3C/INT5)PE5(T3/INT6)PE6(ICP3/CLKO/INT7)PE7(SS/PCINT0)PB0(OC0B)PG5(SCK/PCINT1)PB1(MOSI/PCINT2)PB2(MISO/PCINT3)PB3(OC2A/PCINT4)PB4(OC1A/PCINT5)PB5(OC1B/P