Datasheet

340
7810C–AVR–10/12
Atmel ATmega328P [Preliminary]
17.3 Timer/Counter Clock Sources .......................................................................137
17.4 Counter Unit ..................................................................................................137
17.5 Output Compare Unit .....................................................................................138
17.6 Compare Match Output Unit ..........................................................................140
17.7 Modes of Operation .......................................................................................141
17.8 Timer/Counter Timing Diagrams ...................................................................146
17.9 Asynchronous Operation of Timer/Counter2 .................................................147
17.10 Timer/Counter Prescaler ...............................................................................149
17.11 Register Description ......................................................................................150
18 SPI – Serial Peripheral Interface ......................................................... 158
18.1 Features ........................................................................................................158
18.2 Overview ........................................................................................................158
18.3 SS
Pin Functionality 163
18.4 Data Modes ...................................................................................................163
18.5 Register Description ......................................................................................164
19 USART0 167
19.1 Features ........................................................................................................167
19.2 Overview ........................................................................................................167
19.3 Clock Generation ...........................................................................................168
19.4 Frame Formats ..............................................................................................171
19.5 USART Initialization .......................................................................................173
19.6 Data Transmission – The USART Transmitter ..............................................175
19.7 Data Reception – The USART Receiver .......................................................177
19.8 Asynchronous Data Reception ......................................................................182
19.9 Multi-processor Communication Mode ..........................................................185
19.10 Register Description ......................................................................................187
19.11 Examples of Baud Rate Setting .....................................................................192
20 USART in SPI Mode ............................................................................. 196
20.1 Features ........................................................................................................196
20.2 Overview ........................................................................................................196
20.3 Clock Generation ...........................................................................................196
20.4 SPI Data Modes and Timing ..........................................................................197
20.5 Frame Formats ..............................................................................................198
20.6 Data Transfer .................................................................................................200
20.7 AVR USART MSPIM vs. AVR SPI ................................................................202