Minimizing Power Consumption ......................................................................... 34
System Control and Reset................................................................ 36
Internal Voltage Reference................................................................................. 41
Watchdog Timer ................................................................................................. 41
Interrupts............................................................................................ 44
Interrupt Vectors in ATmega32........................................................................... 44
I/O Ports.............................................................................................. 49
Introduction......................................................................................................... 49
Ports as General Digital I/O................................................................................ 50
Alternate Port Functions ..................................................................................... 54
Register Description for I/O Ports....................................................................... 64
External Interrupts............................................................................. 66
8-bit Timer/Counter0 with PWM........................................................ 69
Overview............................................................................................................. 69
Timer/Counter Clock Sources............................................................................. 70
Counter Unit........................................................................................................ 70
Output Compare Unit.......................................................................................... 71
Compare Match Output Unit............................................................................... 72
Modes of Operation ............................................................................................ 73
Timer/Counter Timing Diagrams......................................................................... 78
8-bit Timer/Counter Register Description ........................................................... 80
Timer/Counter0 and Timer/Counter1 Prescalers............................ 84
16-bit Timer/Counter1........................................................................ 86
Overview............................................................................................................. 86
Accessing 16-bit Registers ................................................................................. 89
Timer/Counter Clock Sources............................................................................. 91
Counter Unit........................................................................................................ 91
Input Capture Unit............................................................................................... 93
Output Compare Units........................................................................................ 94
Compare Match Output Unit............................................................................... 96
Modes of Operation ............................................................................................ 97
Timer/Counter Timing Diagrams....................................................................... 105
16-bit Timer/Counter Register Description ....................................................... 107
8-bit Timer/Counter2 with PWM and Asynchronous Operation.. 114
Overview........................................................................................................... 114
Timer/Counter Clock Sources........................................................................... 115
Counter Unit...................................................................................................... 115
Output Compare Unit........................................................................................ 116
ii
ATmega32(L)
2503J–AVR–10/06