Datasheet
iv
2549O–AVR–05/12
ATmega640/1280/1281/2560/2561
19 Output Compare Modulator (OCM1C0A) ........................................... 172
19.1 Overview ........................................................................................................172
19.2 Description .....................................................................................................172
20 8-bit Timer/Counter2 with PWM and Asynchronous Operation ...... 174
20.1 Overview ........................................................................................................174
20.2 Timer/Counter Clock Sources .......................................................................175
20.3 Counter Unit ..................................................................................................175
20.4 Modes of Operation .......................................................................................176
20.5 Output Compare Unit .....................................................................................180
20.6 Compare Match Output Unit ..........................................................................182
20.7 Timer/Counter Timing Diagrams ...................................................................183
20.8 Asynchronous Operation of Timer/Counter2 .................................................184
20.9 Timer/Counter Prescaler ...............................................................................186
20.10 Register Description ......................................................................................187
21 SPI – Serial Peripheral Interface ......................................................... 195
21.1 SS Pin Functionality ......................................................................................200
21.2 Register Description ......................................................................................202
22 USART ................................................................................................... 205
22.1 Features ........................................................................................................205
22.2 Clock Generation ...........................................................................................206
22.3 Frame Formats ..............................................................................................209
22.4 USART Initialization .......................................................................................210
22.5 Data Transmission – The USART Transmitter ..............................................212
22.6 Data Reception – The USART Receiver .......................................................214
22.7 Asynchronous Data Reception ......................................................................218
22.8 Multi-processor Communication Mode ..........................................................221
22.9 Register Description ......................................................................................222
22.10 Examples of Baud Rate Setting .....................................................................227
23 USART in SPI Mode ............................................................................. 232
23.1 Overview ........................................................................................................232
23.2 USART MSPIM vs. SPI .................................................................................232
23.3 SPI Data Modes and Timing ..........................................................................233
23.4 Frame Formats ..............................................................................................234
23.5 Data Transfer .................................................................................................236
23.6 USART MSPIM Register Description ............................................................237