Datasheet

iii
2466T–AVR–07/10
ATmega16(L)
8-bit Timer/Counter2 with PWM and Asynchronous Operation 117
Overview 117
Timer/Counter Clock Sources 118
Counter Unit 118
Output Compare Unit 119
Compare Match Output Unit 121
Modes of Operation 122
Timer/Counter Timing Diagrams 126
8-bit Timer/Counter Register Description 128
Asynchronous Operation of the Timer/Counter 131
Timer/Counter Prescaler 134
Serial Peripheral Interface – SPI 135
SS Pin Functionality 140
Data Modes 143
USART 144
Overview 144
Clock Generation 145
Frame Formats 148
USART Initialization 149
Data Reception – The USART Receiver 154
Asynchronous Data Reception 157
Multi-processor Communication Mode 161
Accessing UBRRH/ UCSRC Registers 162
USART Register Description 163
Examples of Baud Rate Setting 168
Two-wire Serial Interface 172
Features 172
Two-wire Serial Interface Bus Definition 172
Data Transfer and Frame Format 173
Multi-master Bus Systems, Arbitration and Synchronization 176
Overview of the TWI Module 178
TWI Register Description 180
Using the TWI 183
Transmission Modes 186
Multi-master Systems and Arbitration 199
Analog Comparator 201
Analog Comparator Multiplexed Input 203
Analog to Digital Converter 204
Features 204
Operation 205
Starting a Conversion 206