ii
2467S–AVR–07/09
ATmega128
Power-down Mode 46
Power-save Mode 46
Standby Mode 47
Extended Standby Mode 47
Minimizing Power Consumption 48
System Control and Reset 50
Internal Voltage Reference 54
Watchdog Timer 55
Timed Sequences for Changing the Configuration of the Watchdog Timer 58
Interrupts 60
Interrupt Vectors in ATmega128 60
I/O Ports 66
Introduction 66
Ports as General Digital I/O 67
Alternate Port Functions 71
Register Description for I/O Ports 87
External Interrupts 90
8-bit Timer/Counter0 with PWM and Asynchronous Operation 93
Overview 93
Timer/Counter Clock Sources 94
Counter Unit 94
Output Compare Unit 95
Compare Match Output Unit 97
Modes of Operation 98
Timer/Counter Timing Diagrams 102
8-bit Timer/Counter Register Description 104
Asynchronous Operation of the Timer/Counter 107
Timer/Counter Prescaler 110
16-bit Timer/Counter (Timer/Counter1 and Timer/Counter3) 112
Overview 112
Accessing 16-bit Registers 115
Timer/Counter Clock Sources 118
Counter Unit 118
Input Capture Unit 119
Output Compare Units 121
Compare Match Output Unit 123
Modes of Operation 124
Timer/Counter Timing Diagrams 131
16-bit Timer/Counter Register Description 133