Datasheet
ii
ATtiny2313
2543H–AVR–02/05
Interrupts ............................................................................................ 43
Interrupt Vectors in ATtiny2313 .......................................................................... 43
I/O-Ports.............................................................................................. 45
Introduction......................................................................................................... 45
Ports as General Digital I/O ................................................................................ 46
Alternate Port Functions ..................................................................................... 50
Register Description for I/O-Ports....................................................................... 57
External Interrupts............................................................................. 58
Pin Change Interrupt Timing............................................................................... 58
8-bit Timer/Counter0 with PWM........................................................ 62
Overview............................................................................................................. 62
Timer/Counter Clock Sources............................................................................. 63
Counter Unit........................................................................................................ 63
Output Compare Unit.......................................................................................... 64
Compare Match Output Unit ............................................................................... 65
Modes of Operation ............................................................................................ 66
Timer/Counter Timing Diagrams......................................................................... 71
8-bit Timer/Counter Register Description ........................................................... 73
Timer/Counter0 and Timer/Counter1 Prescalers ............................ 80
16-bit Timer/Counter1........................................................................ 82
Overview............................................................................................................. 82
Accessing 16-bit Registers ................................................................................. 84
Timer/Counter Clock Sources............................................................................. 88
Counter Unit........................................................................................................ 88
Input Capture Unit............................................................................................... 89
Output Compare Units ........................................................................................ 91
Compare Match Output Unit ............................................................................... 93
Modes of Operation ............................................................................................ 94
Timer/Counter Timing Diagrams....................................................................... 102
16-bit Timer/Counter Register Description ....................................................... 104
USART .............................................................................................. 111
Overview........................................................................................................... 111
Clock Generation.............................................................................................. 112
Frame Formats ................................................................................................. 115
USART Initialization.......................................................................................... 116
Data Transmission – The USART Transmitter ................................................. 118
Data Reception – The USART Receiver .......................................................... 121
Asynchronous Data Reception ......................................................................... 124
Multi-processor Communication Mode ............................................................. 128
USART Register Description ............................................................................ 129