Datasheet

ii
ATtiny2313/V
2543F–AVR–08/04
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
8-bit Timer/Counter0 with PWM........................................................ 61
Overview............................................................................................................. 61
Timer/Counter Clock Sources............................................................................. 62
Counter Unit........................................................................................................ 62
Output Compare Unit.......................................................................................... 63
Compare Match Output Unit ............................................................................... 64
Modes of Operation ............................................................................................ 65
Timer/Counter Timing Diagrams......................................................................... 70
8-bit Timer/Counter Register Description ........................................................... 72
Timer/Counter0 and Timer/Counter1 Prescalers ............................ 79
16-bit Timer/Counter1........................................................................ 81
Overview............................................................................................................. 81
Accessing 16-bit Registers ................................................................................. 83
Timer/Counter Clock Sources............................................................................. 87
Counter Unit........................................................................................................ 87
Input Capture Unit............................................................................................... 88
Output Compare Units ........................................................................................ 90
Compare Match Output Unit ............................................................................... 92
Modes of Operation ............................................................................................ 93
Timer/Counter Timing Diagrams....................................................................... 101
16-bit Timer/Counter Register Description ....................................................... 103
USART .............................................................................................. 110
Overview........................................................................................................... 110
Clock Generation.............................................................................................. 111
Frame Formats ................................................................................................. 114
USART Initialization.......................................................................................... 115
Data Transmission – The USART Transmitter ................................................. 117
Data Reception – The USART Receiver .......................................................... 120
Asynchronous Data Reception ......................................................................... 123
Multi-processor Communication Mode ............................................................. 127
USART Register Description ............................................................................ 128
Examples of Baud Rate Setting........................................................................ 133