Datasheet

iii
ATmega640/1280/1281/2560/2561
2549K–AVR–01/07
Timer/Counter Clock Sources........................................................................... 143
Counter Unit...................................................................................................... 143
Input Capture Unit............................................................................................. 144
Output Compare Units ...................................................................................... 146
Compare Match Output Unit ............................................................................. 148
Modes of Operation .......................................................................................... 149
Timer/Counter Timing Diagrams....................................................................... 157
Register Description ......................................................................................... 160
Timer/Counter 0, 1, 3, 4, and 5 Prescaler....................................... 172
Register Description ......................................................................................... 173
Output Compare Modulator (OCM1C0A) ....................................... 174
Overview........................................................................................................... 174
Description........................................................................................................ 174
8-bit Timer/Counter2 with PWM and Asynchronous Operation .. 176
Overview........................................................................................................... 176
Timer/Counter Clock Sources........................................................................... 177
Counter Unit...................................................................................................... 177
Modes of Operation .......................................................................................... 179
Output Compare Unit........................................................................................ 184
Compare Match Output Unit ............................................................................. 185
Timer/Counter Timing Diagrams....................................................................... 186
Asynchronous Operation of Timer/Counter2 .................................................... 188
Timer/Counter Prescaler................................................................................... 190
Register Description ......................................................................................... 191
SPI – Serial Peripheral Interface..................................................... 199
SS Pin Functionality.......................................................................................... 204
Data Modes ...................................................................................................... 204
Register Description ......................................................................................... 206
USART .............................................................................................. 209
Overview........................................................................................................... 209
Clock Generation.............................................................................................. 211
Frame Formats ................................................................................................. 214
USART Initialization.......................................................................................... 215
Data Transmission – The USART Transmitter ................................................. 216
Data Reception – The USART Receiver .......................................................... 219
Asynchronous Data Reception ......................................................................... 223
Multi-processor Communication Mode ............................................................. 226
Register Description ......................................................................................... 227
Examples of Baud Rate Setting........................................................................ 232
USART in SPI Mode ......................................................................... 236