i
2467S–AVR–07/09
ATmega128
Table of
Contents
Features 1
Pin Configurations 2
Overview 2
Block Diagram 3
ATmega103 and ATmega128 Compatibility 4
Pin Descriptions 5
Resources 8
Data Retention 8
About Code Examples 9
AVR CPU Core 10
Introduction 10
Architectural Overview 10
ALU – Arithmetic Logic Unit 11
Status Register 11
General Purpose Register File 12
Stack Pointer 14
Instruction Execution Timing 14
Reset and Interrupt Handling 15
AVR ATmega128 Memories 18
In-System Reprogrammable Flash Program Memory 18
SRAM Data Memory 19
EEPROM Data Memory 21
I/O Memory 26
External Memory Interface 26
System Clock and Clock Options 36
Clock Systems and their Distribution 36
Clock Sources 37
Default Clock Source 38
Crystal Oscillator 39
Low-frequency Crystal Oscillator 40
External RC Oscillator 40
Calibrated Internal RC Oscillator 42
External Clock 43
Timer/Counter Oscillator 44
Power Management and Sleep Modes 45
Idle Mode 46
ADC Noise Reduction Mode 46