Datasheet
iii
ATmega325/3250/645/6450
2570K–AVR–04/07
Modes of Operation .......................................................................................... 111
Timer/Counter Timing Diagrams....................................................................... 118
16-bit Timer/Counter Register Description ....................................................... 120
8-bit Timer/Counter2 with PWM and Asynchronous Operation .. 127
Overview........................................................................................................... 127
Timer/Counter Clock Sources........................................................................... 128
Counter Unit...................................................................................................... 128
Output Compare Unit........................................................................................ 129
Compare Match Output Unit ............................................................................. 131
Modes of Operation .......................................................................................... 132
Timer/Counter Timing Diagrams....................................................................... 136
8-bit Timer/Counter Register Description ......................................................... 138
Asynchronous operation of the Timer/Counter................................................. 141
Timer/Counter Prescaler................................................................................... 144
SPI – Serial Peripheral Interface..................................................... 146
Overview........................................................................................................... 146
SS
Pin Functionality.......................................................................................... 151
Data Modes ...................................................................................................... 154
USART0 ............................................................................................ 155
Overview........................................................................................................... 155
Clock Generation.............................................................................................. 156
Frame Formats ................................................................................................. 159
USART Initialization.......................................................................................... 160
Data Transmission – The USART Transmitter ................................................. 162
Data Reception – The USART Receiver .......................................................... 165
Asynchronous Data Reception ......................................................................... 168
Multi-processor Communication Mode ............................................................. 172
USART Register Description ............................................................................ 173
Examples of Baud Rate Setting........................................................................ 177
USI – Universal Serial Interface...................................................... 181
Overview........................................................................................................... 181
Functional Descriptions .................................................................................... 182
Alternative USI Usage ...................................................................................... 188
USI Register Descriptions................................................................................. 188
Analog Comparator ......................................................................... 194
Analog Comparator Multiplexed Input .............................................................. 196
Analog to Digital Converter ............................................................ 197
Features............................................................................................................ 197
Operation .......................................................................................................... 198
Starting a Conversion ....................................................................................... 199