Datasheet
22.7. Modes of Operation..................................................................................................................204
22.8. Timer/Counter Timing Diagrams.............................................................................................. 208
22.9. Asynchronous Operation of Timer/Counter2............................................................................209
22.10. Timer/Counter Prescaler.......................................................................................................... 211
22.11. Register Description................................................................................................................. 211
23. Serial Peripheral Interface (SPI)............................................................................226
23.1. Features................................................................................................................................... 226
23.2. Overview.................................................................................................................................. 226
23.3. SS Pin Functionality................................................................................................................. 230
23.4. Data Modes..............................................................................................................................230
23.5. Register Description................................................................................................................. 231
24. Universal Synchronous Asynchronous Receiver Transceiver (USART)............... 236
24.1. Features................................................................................................................................... 236
24.2. Overview.................................................................................................................................. 236
24.3. Block Diagram..........................................................................................................................236
24.4. Clock Generation......................................................................................................................237
24.5. Frame Formats.........................................................................................................................240
24.6. USART Initialization................................................................................................................. 241
24.7. Data Transmission – The USART Transmitter......................................................................... 242
24.8. Data Reception – The USART Receiver.................................................................................. 244
24.9. Asynchronous Data Reception.................................................................................................248
24.10. Multi-Processor Communication Mode.................................................................................... 251
24.11. Examples of Baud Rate Setting............................................................................................... 251
24.12. Register Description.................................................................................................................254
25. USART in SPI (USARTSPI) Mode.........................................................................264
25.1. Features................................................................................................................................... 264
25.2. Overview.................................................................................................................................. 264
25.3. Clock Generation......................................................................................................................264
25.4. SPI Data Modes and Timing.....................................................................................................265
25.5. Frame Formats.........................................................................................................................265
25.6. Data Transfer............................................................................................................................267
25.7. AVR USART MSPIM vs. AVR SPI............................................................................................268
25.8. Register Description................................................................................................................. 269
26. Two-Wire Serial Interface (TWI)............................................................................ 270
26.1. Features................................................................................................................................... 270
26.2. Two-Wire Serial Interface Bus Definition..................................................................................270
26.3. Data Transfer and Frame Format.............................................................................................271
26.4. Multi-Master Bus Systems, Arbitration, and Synchronization...................................................274
26.5. Overview of the TWI Module.................................................................................................... 276
26.6. Using the TWI...........................................................................................................................278
26.7. Transmission Modes................................................................................................................ 281
26.8. Multi-Master Systems and Arbitration...................................................................................... 299
26.9. Register Description................................................................................................................. 300
ATmega48A/88A/168A
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40002007A-page 6