– 130 Powe rful Instructions – Most Single Clock Cy cle 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
– In-System Self-programmable Flash Program Memory
• 32K Bytes (ATmega325/ATmega3250)
• 64K Bytes (ATmega645/ATmega6450)
– EEPROM
• 1K bytes (ATmega325/ATmega3250)
• 2K bytes (ATmega645/ATmega6450)
– Internal SRAM
• 2K bytes (ATmega325/ATmega3250)
• 4K bytes (ATmega645/ATmega6450)
– Write/Erase Cycles: 10,000 Flash/ 100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C
– 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
• 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
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
– Real Time Counter with Separate Oscillator
–Four PWM Channels
– 8-channel, 10-bit ADC
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Universal Serial Interface with Start Condition Detector
– 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 Pr ogrammab l e Brown-out Detection
– Internal Calibrated Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Note:The large center pad underneath the QFN/MLF packages is made of metal and inter nally con-
nected to GND. It should be soldered or glued to the board to ensure good mechanical stability. If
the center pad is left unconnected, the package might loosen from the board.
Typical values contained in this datasheet are based on simulations and characterization of
other AVR microcontrollers manufactured o n th e same proce ss te ch nolo gy. Min a nd Ma x valu es
will be available after the device is characterized.
The ATmega325/3250/645/6450 is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega325/3250/645/6450 achieves through puts approaching 1 MIPS per MHz a llowing the
system designer to optimize power consumption versus processing speed.
3
ATmega325/3250/645/6450
3.1Block Diagram
Figure 3-1.Block Diagram
AVCC
AGND
AREF
PH0 - PH7
PORTH DRIVERS
VCCGND
DATA DIR.
REG. PORTH
PORTH
DATA REGISTER
DATA DIR.
REG. PORTJ
DATA REGISTER
JTAG TAP
ON-CHIP DEBUG
BOUNDARY-
SCAN
PROGRAMMING
LOGIC
PORTF
AVR CPU
PORTF DRIVERS
ADC
PROGRAM
COUNTER
PROGRAM
FLASH
INSTRUCTION
REGISTER
INSTRUCTION
DECODER
CONTROL
LINES
DATA DIR.
REG. PORTF
DATA REGISTER
PORTA
STACK
POINTER
SRAM
GENERAL
PURPOSE
REGISTERS
X
Y
Z
ALU
STATUS
REGISTER
PA0 - PA7PF0 - PF7
PORTA DRIVERS
DATA DIR.
REG. PORTA
8-BIT DATA BUS
INTERNAL
OSCILLATOR
WATCHDOG
TIMER
MCU CONTROL
REGISTER
TIMER/
COUNTERS
INTERRUPT
UNIT
EEPROM
PORTC DRIVERS
DATA REGISTER
PORTC
CALIB. OSC
OSCILLATOR
TIMING AND
CONTROL
PC0 - PC7
DATA DIR.
REG. PORTC
XTAL1
XTAL2
RESET
4
PJ0 - PJ6
PORTJ DRIVERS
PORTJ
DATA REGISTER
ANALOG
COMPARATOR
DATA REGISTER
+
-
USART
PORTE
UNIVERSAL
SERIAL INTERFACE
REG. PORTE
PORTE DRIVERS
DATA DIR.
DATA REGISTER
PORTB
PORTB DRIVERS
DATA DIR.
REG. PORTB
PB0 - PB7PE0 - PE7
SPI
DATAREGISTER
PORTD
PORTD DRIVERS
PD0 - PD7
DATA DIR.
REG. PORTD
DATAREG.
PORTG
PORTG DRIVERS
DATA DIR.
REG. PORTG
PG0 - PG4
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
registers to be accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers.
2570LS–AVR–08/07
ATmega325/3250/645/6450
The ATmega325/3250/645/6450 provides the following features: 32/64K bytes of In-System
Programmable Flash with Read-While-Write capabilities, 1/2K bytes EEPROM, 2/4K byte
SRAM, 54/69 general purpose I/O lines, 32 general purpose working registers, a JTAG interface
for Boundary-scan, On-chip Debugging sup port an d pro gramming, three flexib le Timer /Co unters
with compare modes, internal and external interrupts, a serial programmable USART, Universal
Serial Interface with Start Condition Detector, an 8-channel, 10-bit ADC, a programmable
Watchdog Timer with internal Oscillator, an SPI serial port, and five software selectable power
saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI
port, and interrupt system to continue functioning. The Power-down mode saves the register
contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or
hardware reset. In Power-save mode, the asynchronous timer will continue to run, allowing the
user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction
mode stops the CPU and all I/O modules except asynchron ous timer and ADC to minimize
switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is
running while the rest of the device is sle eping. This allows very fast start-up combined with lowpower consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology. The
On-chip In-System re-Programmable (ISP) Flash allows the program memory to be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory
programmer, or by an On-chip Boot program running on the AVR core. The Bo ot program can
use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the Application Flash section is updated,
providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System
Self-Programmable Flash on a monolithic chip, the Atmel ATmega325/3250/645/6450 is a powerful microcontroller that provides a highly flexible and cost effective solut ion to many embed ded
control applications.
The ATmega325/3250/645/6450 AVR is supported with a full suite of program and system
development tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators,
In-Circuit Emulators, and Evaluation kits.
3.2Comparison between ATmega325, ATmega3250, ATmega645 and ATmega6450
The ATmega325, ATmega3250, ATmega645, and ATmega6450 differs only in memory sizes,
pin count and pinout. Table 3-1 on page 5 summarizes the different configurations for the four
devices.
The following section describes the I/O-pin special funct ion s.
2570LS–AVR–08/07
5
ATmega325/3250/645/6450
3.3.1V
3.3.2GND
3.3.3Port A (PA7..PA0)
3.3.4Port B (PB7..PB0)
CC
Digital supply voltage.
Ground.
Port A is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port A output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port A pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port A pins are tri-stated when a reset co ndition becomes active,
even if the clock is not running.
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port B output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset co ndition becomes active,
even if the clock is not running.
Port B has better driving capabilities than the other ports.
Port B also serves the function s of various special features of the ATmega325/3250/645/6450
as listed on page 67.
3.3.5Port C (PC7..PC0)
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port C output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
3.3.6Port D (PD7..PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port D output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port D also serves the functions of various special features of the ATmega325/3250/645/6450
as listed on page 70.
3.3.7Port E (PE7..PE0)
Port E is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port E output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port E pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port E pins are tri-stated when a reset co ndition becomes active,
even if the clock is not running.
Port E also serves the function s of various special features of the ATmega325/3250/645/6450
as listed on page 71.
6
2570LS–AVR–08/07
3.3.8Port F (PF7..PF0)
Port F serves as the analog inputs to the A/D Converter.
Port F also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins
can provide internal pull-up resistors (selected for each bit) . The Por t F outpu t buffers ha ve symmetrical drive characteristics with both high sink and source capability. As inputs, Port F pins
that are externally pulled low will source current if the pull-up resistors are activated. The Port F
pins are tri-stated when a res et cond ition beco mes a ctive, ev en if th e clock is not ru nning. If the
JTAG interface is enabled, the pull-up resistors on pins PF7(TDI), PF5(TMS), and PF4(TCK) will
be activated even if a reset occurs.
Port F also serves the functions of the JTAG interface.
3.3.9Port G (PG5..PG0)
Port G is a 6-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port G output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port G pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port G pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port G also serves the functions of various specia l features of the ATmega3 25/3250/645/6450
as listed on page 71.
ATmega325/3250/645/6450
3.3.10Port H (PH7..PH0)
Port H is a 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port H output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port H pins that are externally pulled low will source current if the pull-up
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 various special features of the ATmega3250/6450 as listed
on page 71.
3.3.11Port J (PJ6..PJ0)
Port J is a 7-bit bi-directional I/O port with internal pull-up re sistors (selected for each bit). The
Port J output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port J pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port J pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port J also serves the functions of various special features of the ATmega3250/64 50 as listed on
page 71.
3.3.12RESET
Reset input. A low level on this pin for longer than the minimum pulse length will generate a
reset, even if the clock is not running. The minimum pulse length is given in Table 28-4 on page
300. Shorter pulses are not guaranteed to gener at e a re se t.
3.3.13XTAL1
2570LS–AVR–08/07
Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
7
ATmega325/3250/645/6450
3.3.14XTAL2
3.3.15AVCC
3.3.16AREF
4.Resources
5.Data Retention
Output from the inverting Oscillator amplifier.
AVCC is the supply voltage pin for Port F and the A/D Converter. It should be externally connected to V
through a low-pass filter.
This is the analog reference pin for the A/D Converter.
A comprehensive set of development tools, application notes and datasheets are available for
download on http://www.atmel.com/avr.
Note:1.
Reliability Qualification results show that the projected data retention failure rate is much less
than 1 PPM over 20 years at 85°C or 100 years at 25°C.
, even if the ADC is not used. If the ADC is used, it should be connected to V
CC
CC
8
2570LS–AVR–08/07
ATmega325/3250/645/6450
6.Register Summary
Note:Registers with bold type only available in ATmega3250/6450.
Note:1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory addresses
should never be written.
2. I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using the SBI and CBI instructions. In these
registers, the value of single bits can be checked by using the SBIS and SBIC instructions.
3. Some of the Status Flags are cleared by writing a logical one to them. Note that, unlike most other AVRs, the CBI and SBI
instructions will only operate on the specified bit, and can therefore be used on registers containing such Status Flags. The
CBI and SBI instructions work with registers 0x00 to 0x1F only.
4. When using the I/O specific commands IN and OUT, the I/O addresses 0x00 - 0x3F must be used. When addressing I/O
Registers as data space using LD and ST instructions, 0x20 must be added to these addresses. The
ATmega325/3250/645/6450 is a complex microcontroller with more peripheral units than can be supported within the 64
location reserved in Opcode for the IN and OUT instructions. For the Extended I/O space from 0x60 - 0xFF in SRAM, only
the ST/STS/STD and LD/LDS/LDD instructions can be used.
12
2570LS–AVR–08/07
ATmega325/3250/645/6450
7.Instruction Set Summary
MnemonicsOperandsDescriptionOperationFlags#Clocks
ARITHMETIC AND LOGIC INSTRUCTIONS
ADDRd, RrAdd two RegistersRd ← Rd + RrZ,C,N,V,H1
ADCRd, RrAdd with Carry two RegistersRd ← Rd + Rr + CZ,C,N,V,H1
ADIWRdl,KAdd Immediate to WordRdh:Rdl ← Rdh:Rdl + KZ,C,N,V,S2
SUBRd, RrSubtract two RegistersRd ← Rd - RrZ,C,N,V,H1
SUBIRd, KSubtract Constant from Register Rd ← Rd - KZ,C,N,V,H1
SBCRd, RrSubtract with Carry two RegistersRd ← Rd - Rr - CZ,C,N,V,H1
SBCIRd, KSubtract with Carry Constant from Reg.Rd ← Rd - K - CZ,C,N,V,H1
SBIWRdl,KSubtract Immediate from WordRdh:Rdl ← Rdh:Rdl - KZ,C,N,V,S2
ANDRd, RrLogical AND RegistersRd ← Rd • RrZ,N,V1
ANDIRd, KLogical AND Register and ConstantRd ← Rd • KZ,N,V1
ORRd, RrLogical OR RegistersRd ← Rd v RrZ,N,V1
ORIRd, KLogical OR Register and ConstantRd ← Rd v KZ,N,V1
EORRd, RrExclusive OR RegistersRd ← Rd ⊕ RrZ,N,V1
COMRdOne’s ComplementRd ← 0xFF − RdZ,C,N,V1
NEGRdTwo’s ComplementRd ← 0x00 − RdZ,C,N,V,H1
SBRRd,KSet Bit(s) in RegisterRd ← Rd v KZ,N,V1
CBRRd,KClear Bit(s) in RegisterRd ← Rd • (0xFF - K)Z,N,V1
INCRdIncrementRd ← Rd + 1Z,N,V1
DECRdDecrementRd ← Rd − 1 Z,N,V1
TSTRdTest for Zero or MinusRd ← Rd • Rd Z,N,V1
CLRRdClear RegisterRd ← Rd ⊕ RdZ,N,V1
SERRdSet RegisterRd ← 0xFFNone1
MULRd, RrMultiply UnsignedR1:R0 ← Rd x RrZ,C2
MULSRd, RrMultiply SignedR1:R0 ← Rd x RrZ,C2
MULSURd, RrMultiply Signed with UnsignedR1:R0 ← Rd x RrZ,C2
FMULRd, RrFractional Multiply UnsignedR1:R0 ← (Rd x Rr) << 1Z,C2
FMULSRd, RrFractional Multiply SignedR1:R0 ← (Rd x Rr) << 1Z,C2
FMULSURd, RrFractional Multiply Signed with UnsignedR1:R0 ← (Rd x Rr) << 1Z,C2
BRANCH INSTRUCTIONS
RJMPkRelative JumpPC ← PC + k + 1None2
IJMPIndirect Jump to (Z)PC ← Z None2
JMPkDirect JumpPC ← kNone3
RCALLkRelative Subroutine Call PC ← PC + k + 1None3
ICALLIndirect Call to (Z)PC ← ZNone3
CALLkDirect Subroutine Call PC ← kNone4
RETSubroutine ReturnPC ← STACKNone4
RETIInterrupt ReturnPC ← STACKI4
CPSERd,RrCompare, Skip if Equalif (Rd = Rr) PC ← PC + 2 or 3None1/2/3
CPRd,RrCompareRd − RrZ, N,V,C,H1
CPCRd,RrCompare with CarryRd − Rr − CZ, N,V,C,H1
CPIRd,KCompare Register with ImmediateRd − KZ, N,V,C,H1
SBRCRr, bSkip if Bit in Register Clearedif (Rr( b)=0) PC ← PC + 2 or 3 None1/2/3
SBRSRr, bSkip if Bit in Register is Setif (Rr(b)=1) PC ← PC + 2 or 3None1/2/3
SBICP, bSkip if Bit in I/O Register Clearedif (P(b)=0) PC ← PC + 2 or 3 None1/2/3
SBISP, bSkip if Bit in I/O Register is Setif (P(b)=1) PC ← PC + 2 or 3None1/2/3
BRBSs, kBranch if Status Flag Setif (SREG(s) = 1) then PC←PC+k + 1None1/2
BRBCs, kBranch if Status Flag Clearedif (S REG(s) = 0) then PC←PC+k + 1None1/2
BREQ kBranch if Equal if (Z = 1) then PC ← PC + k + 1None1/2
BRNE kBranch if Not Equalif (Z = 0) then PC ← PC + k + 1None1/2
BRCS kBranch if Carry Setif (C = 1) then PC ← PC + k + 1None1/2
BRCC kBranch if Carry Clearedif (C = 0) then PC ← PC + k + 1None1/2
BRSH kBranch if Same or Higher if (C = 0) then PC ← PC + k + 1None1/2
BRLO kBranch if Lowerif (C = 1) then PC ← PC + k + 1None1/2
BRMI kBranch if Minusif (N = 1) then PC ← PC + k + 1None1/2
BRPL kBranch if Plus if (N = 0) then PC ← PC + k + 1None1/2
BRGE kBranch if Greater or Equal, Signedif (N ⊕ V= 0) then PC ← PC + k + 1None1/2
BRLT kBranch if Less Than Zero, Signedif (N ⊕ V= 1) then PC ← PC + k + 1None1/2
BRHS kBranch if Half Carry Flag Setif (H = 1) then PC ← PC + k + 1None1/2
BRHC kBranch if Half Carry Flag Cle aredif (H = 0) then PC ← PC + k + 1None1/2
BRTS kBranch if T Flag Setif (T = 1) then PC ← PC + k + 1None1/2
2570LS–AVR–08/07
13
ATmega325/3250/645/6450
MnemonicsOperandsDescriptionOperationFlags#Clocks
BRTC kBranch if T Flag Clearedif (T = 0) then PC ← PC + k + 1None1/2
BRVS kBranch if Overflow Flag is Setif (V = 1) then PC ← PC + k + 1None1/2
BRVC kBranch if Overflow Flag is Clearedif (V = 0) then PC ← PC + k + 1None1/2
BRIE kBranch if Interrupt Enabledif ( I = 1) then PC ← PC + k + 1None1/2
BRID kBranch if Interrupt Disabledif ( I = 0) then PC ← PC + k + 1None1/2
BIT AND BIT-TEST INSTRUCTIONS
SBIP,bSet Bit in I/O RegisterI/O(P,b) ← 1None2
CBIP,bClear Bit in I/O RegisterI/O(P,b) ← 0None2
LSLRdLogical Shift LeftRd(n+1) ← Rd(n), Rd(0) ← 0Z,C,N,V1
LSRRdLogical Shift RightRd(n) ← Rd(n+1), Rd(7) ← 0Z,C,N,V1
ROLRdRotate Left Through CarryRd(0)←C,Rd(n+1)← Rd(n),C←Rd(7)Z,C,N,V1
RORRdRotate Right Through CarryRd(7)←C,Rd(n)← Rd(n+1),C←Rd(0)Z,C,N,V1
ASRRdArithmetic Shift RightRd(n) ← Rd(n+1), n=0..6Z,C,N,V1
SWAPRdSwap NibblesRd(3..0)←Rd(7..4),Rd(7..4)←Rd(3..0)None1
BSETsFlag SetSREG(s) ← 1SREG(s)1
BCLRsFlag ClearSR EG(s) ← 0 SREG(s)1
BSTRr, bBit Store from Register to TT ← Rr(b)T1
BLDRd, bBit load from T to RegisterRd(b) ← TNone1
SECSet CarryC ← 1C1
CLCClear CarryC ← 0 C1
SENSet Negative FlagN ← 1N1
CLNClear Negative FlagN ← 0 N1
SEZSet Zero FlagZ ← 1Z1
CLZClear Zero FlagZ ← 0 Z1
SEIGlobal Interrupt EnableI ← 1I1
CLIGlobal Interrupt DisableI ← 0 I1
SESSet Signed Test FlagS ← 1S1
CLSClear Signed Test FlagS ← 0 S1
SEVSet Twos Complement Overflow.V ← 1V1
CLVClear Twos Complement OverflowV ← 0 V1
SETSet T in SREGT ← 1T1
CLTClear T in SREGT ← 0 T1
SEHSet Half Carry Flag in SREGH ← 1H1
CLHClear Half Carry Flag in SREGH ← 0 H1
DATA TRANSFER INSTRUCTIONS
MOVRd, RrMove Between RegistersRd ← RrNone1
MOVWRd, RrCopy Register Word
LDIRd, KLoad ImmediateRd ← KNone1
LDRd, XLoad IndirectRd ← (X)None2
LDRd, X+Load Indirect and Post-Inc.Rd ← (X), X ← X + 1None2
LDRd, - XLoad Indirect and Pre-Dec.X ← X - 1, Rd ← (X)None2
LDRd, YLoad IndirectRd ← (Y)None2
LDRd, Y+Load Indirect and Post-Inc.Rd ← (Y), Y ← Y + 1None2
LDRd, - YLoad Indirect and Pre-Dec.Y ← Y - 1, Rd ← (Y)None2
LDDRd,Y+qLoad Indirect with DisplacementRd ← (Y + q)None2
LDRd, ZLoad Indirect Rd ← (Z)None2
LDRd, Z+Load Indirect and Post-Inc.Rd ← (Z), Z ← Z+1None2
LDRd, -ZLoad Indirect and Pre-Dec.Z ← Z - 1, Rd ← (Z)None2
LDDRd, Z+qLoad Indirect with DisplacementRd ← (Z + q)None2
LDSRd, kLoad Direct from SRAMRd ← (k)None2
STX, RrStore Indirect(X) ← RrNone2
STX+, RrStore Indirect and Post-Inc.(X) ← Rr, X ← X + 1None2
ST- X, RrStore Indirect and Pre-Dec.X ← X - 1, (X) ← RrNone2
STY, RrStore Indirect(Y) ← RrNone2
STY+, RrStore Indirect and Post-Inc.(Y) ← Rr, Y ← Y + 1None2
ST- Y, RrStore Indirect and Pre-Dec.Y ← Y - 1, (Y) ← RrNone2
STDY+q,RrStore Indirect with Displacement(Y + q) ← RrNone2
STZ, RrStore Indirect(Z) ← RrNone2
STZ+, RrStore Indirect and Post-Inc.(Z) ← Rr, Z ← Z + 1None2
ST-Z, RrStore Indirect and Pre-Dec.Z ← Z - 1, (Z) ← RrNone2
STDZ+q,RrStore Indirect with Displ ace ment(Z + q) ← RrNone2
STSk, RrStore Direct to SRAM(k) ← RrNone2
LPMLoad Program MemoryR0 ← (Z)None3
LPMRd, ZLoad Program MemoryRd ← (Z)N one3
LPMRd, Z+Load Program Memory and Post-IncRd ← (Z), Z ← Z+1None3
SPMStore Program Memory(Z) ← R1:R0None-
NOPNo OperationNone1
SLEEPSleep(see specific descr. for Sleep function)None1
WDRWatchdog Reset(see specific descr. for WDR/timer)None1
BREAKBreakFor On-chip Debug OnlyNoneN/A
2570LS–AVR–08/07
15
ATmega325/3250/645/6450
8.Ordering Information
8.1ATmega325
Speed (MHz)
Notes:1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information
2. Pb-free packaging alternative, complies to the European Directive for Restriction of Hazardous Substances (RoHS direc-
3. For Speed Grades see Figure 28-1 on page 298 and Figure 28-2 on page 298.
64A64-lead , 14 x 14 x 1.0 mm, Thin Profile Plastic Quad Flat Package (TQFP)
64M164-pad, 9 x 9 x 1.0 mm, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)
100A100-lead, 14 x 14 x 1.0 mm, 0.5 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
2570LS–AVR–08/07
17
ATmega325/3250/645/6450
8.2ATmega3250
Speed (MHz)
Notes:1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information
2. Pb-free packaging alternative, complies to the European Directive for Restriction of Hazardous Substances (RoHS direc-
3. For Speed Grades see Figure 28-1 on page 298 and Figure 28-2 on page 298.
(3)
81.8 - 5.5V
162.7 - 5.5V
and minimum quantities.
tive). Also Halide free and fully Green.
Power SupplyOrdering CodePackage Type
ATmega3250V -8AI
ATmega3250V-8AU
ATmega3250-16AI
ATmega3250-16AU
(2)
(2)
100A
100A
100A
100A
(1)
Operational Range
Industrial
0°C to 85°C)
(-4
Industrial
(-4
0°C to 85°C)
64A64-lead , 14 x 14 x 1.0 mm, Thin Profile Plastic Quad Flat Package (TQFP)
64M164-pad, 9 x 9 x 1.0 mm, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)
100A100-lead, 14 x 14 x 1.0 mm, 0.5 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
Notes:1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information
and minimum quantities.
2. Pb-free packaging alternative, complies to the European Directive for Restriction of Hazardous Substances (RoHS directive). Also Halide free and fully Green.
3. For Speed Grades see Figure 28-1 on page 298 and Figure 28-2 on page 298.
(1)
Operational Range
Industrial
0°C to 85°C)
(-4
Industrial
(-40°C to 85°C)
Package Type
64A64-lead , 14 x 14 x 1.0 mm, Thin Profile Plastic Quad Flat Package (TQFP)
64M164-pad, 9 x 9 x 1.0 mm, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)
100A100-lead, 14 x 14 x 1.0 mm, 0.5 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
2570LS–AVR–08/07
19
ATmega325/3250/645/6450
8.4ATmega6450
Speed (MHz)
Notes:1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information
2. Pb-free packaging alternative, complies to the European Directive for Restriction of Hazardous Substances (RoHS direc-
3. For Speed Grades see Figure 28-1 on page 298 and Figure 28-2 on page 298.
(3)
81.8 - 5.5V
162.7 - 5.5V
and minimum quantities.
tive). Also Halide free and fully Green.
Power SupplyOrdering CodePackage Type
ATmega6450V -8AI
ATmega6450V-8AU
ATmega6450-16AI
ATmega6450-16AU
(2)
(2)
100A
100A
100A
100A
(1)
Operational Range
Industrial
0°C to 85°C)
(-4
Industrial
(-4
0°C to 85°C)
64A64-lead , 14 x 14 x 1.0 mm, Thin Profile Plastic Quad Flat Package (TQFP)
64M164-pad, 9 x 9 x 1.0 mm, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)
100A100-lead, 14 x 14 x 1.0 mm, 0.5 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
20
Package Type
2570LS–AVR–08/07
9.Packaging Information
9.164A
PIN 1
PIN 1 IDENTIFIER
ATmega325/3250/645/6450
B
e
E1E
D1
D
C
0°~7°
A1
L
Notes:
1.This package conforms to JEDEC reference MS-026, Variation AEB.
2. Dimensions D1 and E1 do not include mold protrusion. Allowable
protrusion is 0.25 mm per side. Dimensions D1 and E1 are maximum
plastic body size dimensions including mold mismatch.
3. Lead coplanarity is 0.10 mm maximum.
A2A
SYMBOL
COMMON DIMENSIONS
(Unit of Measure = mm)
MIN
A – – 1.20
A1 0.05 – 0.15
A2 0.95 1.00 1.05
D 15.75 16.00 16.25
D1 13.90 14.00 14.10 Note 2
E 15.75 16.00 16.25
E1 13.90 14.00 14.10 Note 2
B 0.30 – 0.45
C 0.09 – 0.20
L 0.45 – 0.75
e 0.80 TYP
NOM
MAX
NOTE
2570LS–AVR–08/07
2325 Orchard Parkway
R
San Jose, CA 95131
TITLE
64A, 64-lead, 14 x 14 mm Body Size, 1.0 mm Body Thickness,
0.8 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
10/5/2001
DRAWING NO.
64A
REV.
B
21
ATmega325/3250/645/6450
9.264M1
D
Marked Pin# 1 ID
E
SEATING PLANE
C
TOP VIEW
A1
A
K
L
D2
E2
K
b
e
BOTTOM VIEW
1. JEDEC Standard MO-220, (SAW Singulation) Fig. 1, VMMD.
Note:
2. Dimension and tolerance conform to ASMEY14.5M-1994.
Pin #1 Corner
1
2
3
Option A
Option B
Option C
Pin #1
Triangle
Pin #1
Chamfer
(C 0.30)
Pin #1
Notch
(0.20 R)
SIDE VIEW
SYMBOL
A 0.80 0.90 1.00
A1 – 0.02 0.05
b 0.180.250.30
D
D2 5.205.405.60
E
E2 5.205.405.60
e 0.50 BSC
L0.35 0.40 0.45
K1.251.401.55
0.08
C
COMMON DIMENSIONS
(Unit of Measure = mm)
MIN
8.909.009.10
8.909.009.10
NOM
MAX
NOTE
2325 Orchard Parkway
R
San Jose, CA 95131
TITLE
64M1, 64-pad, 9 x 9 x 1.0 mm Body, Lead Pitch 0.50 mm,
5.40 mm Exposed Pad, Micro Lead Frame Package (MLF)
22
5/25/06
DRAWING NO.
64M1
REV.
G
2570LS–AVR–08/07
9.3100A
ATmega325/3250/645/6450
PIN 1
B
PIN 1 IDENTIFIER
e
E1E
D1
D
C
0˚~7˚
A1
L
Notes:1. This package conforms to JEDEC reference MS-026, Variation AED.
2. Dimensions D1 and E1 do not include mold protrusion. Allowable
protrusion is 0.25 mm per side. Dimensions D1 and E1 are maximum
plastic body size dimensions including mold mismatch.
3. Lead coplanarity is 0.08 mm maximum.
A2A
SYMBOL
COMMON DIMENSIONS
(Unit of Measure = mm)
MIN
A––1.20
A10.05–0.15
A2 0.951.001.05
D15.7516.0016.25
D113.9014.0014.10Note 2
E15.7516.0016.25
E113.9014.0014.10Note 2
B 0.17–0.27
C0.09–0.20
L0.45– 0.75
e0.50 TYP
NOM
MAX
NOTE
2570LS–AVR–08/07
2325 Orchard Parkway
R
San Jose, CA 95131
TITLE
100A, 100-lead, 14 x 14 mm Body Size, 1.0 mm Body Thickness,
0.5 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP)
10/5/2001
DRAWING NO.
100A
REV.
C
23
ATmega325/3250/645/6450
10. Errata
10.1Errata ATmega325
The revision letter in this section refers to the revision of the ATmega325 device.
10.1.1ATmega325 Rev. C
•
Interrupts may be lost when writing the timer registers in the asynchronous timer
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
10.1.2ATmega325 Rev. B
Not sampled.
10.1.3ATmega325 Rev. A
•
Interrupts may be lost when writing the timer registers in the asynchronous timer
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
10.2Errata ATmega3250
The revision letter in this section refers to the revision of the ATmega3250 device.
10.2.1ATmega3250 Rev. C
•
Interrupts may be lost when writing the timer registers in the asynchronous timer
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
10.2.2ATmega3250 Rev. B
Not sampled.
24
2570LS–AVR–08/07
10.2.3ATmega3250 Rev. A
Interrupts may be lost when writing the timer registers in the asynchronous timer
•
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
10.3Errata ATmega645
The revision letter in this section refers to the revision of the ATmega645 device.
10.3.1ATmega645 Rev. A
•
Interrupts may be lost when writing the timer registers in the asynchronous timer
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
ATmega325/3250/645/6450
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
10.4Errata ATmega6450
The revision letter in this section refers to the revision of the ATmega6450 device.
10.4.1ATmega6450 Rev. A
Interrupts may be lost when writing the timer registers in the asynchronous timer
•
1.Interrupts may be lost when writing the timer registers in the asynchronous timer
If one of the timer registers which is synchronized to the asynchronous timer2 clock is written in the cycle before a overflow interrupt occurs, the interrupt may be lost.
Problem Fix/ Workaround
Always check that the Timer2 Timer/Counter register, TCNT2, does not have the value 0xFF
before writing the Timer2 Control Register, TCCR2, or Output Compare Register, OCR2.
2570LS–AVR–08/07
25
ATmega325/3250/645/6450
11. 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 referring to the document revision.
11.1Rev. 2570L – 08/07
1.Updated “Features” on page 1.
2.Added “Data Retention” on page 8.
3.Updated “Serial Programming Algorithm” on page 280.
4.Updated “Speed Grades” on page 298.
5.Updated “System and Reset Characteristics” on page 300.
6.Updated the Register Description at the end of each chapter.
11.2Rev. 2570K – 04/07
1.Updated “Errata” on page 24.
11.3Rev. 2570J – 11/06
1.Updated Table 28-7 on page 303.
2.Updated note in Table 28-7 on page 303.
11.4Rev. 2570I – 07/06
1.Updated Table 15-6 on page 91.
2.Updated Table 15-2 on page 96, Table 15-4 on page 96, Table 17-3 on page
3.Updated “Fast PWM Mode” on page 114.
4.Updated Features in “USI – Universal Serial Interface” on page 184.
5.Added “Clock speed considerations.” on page 190.
6.Updated “Errata” on page 24.
11.5Rev. 2570H – 06/06
1.Updated “Calibrated Internal RC Oscillator” on page 28.
2.Updated “OSCCAL – Oscillator Calibration Register” on page 31.
3.Added Table 28-2 on page 299.
123, Table 17-5 on page 124, Table 18-2 on page 142 and Table 18-4 on page
143.
26
2570LS–AVR–08/07
11.6Rev. 2570G – 04/06
1.Updated “Calibrated Internal RC Oscillator” on page 28.
11.7Rev. 2570F – 03/06
1.Updated “Errata” on page 24.
11.8Rev. 2570E – 03/06
1.Added Addresses in Register Descriptions.
2.Updated number of Genearl Purpose I/O pins.
3.Correction of Bitnames in “Register Summary” on page 9.
4.Added “Resources” on page 8.
5.Updated “Power Management and Sleep Modes” on page 34.