Analog comparator
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN1 → PB1 · AIN0 → PB0
Package pin assignments for ATtiny45, ATtiny85, with peripheral signals, clock grades and a serial programming guide.
| Package | Contacts | Details |
|---|---|---|
| PDIP-8 | 8 | 8 numbered contacts. See the individual package drawings for footprint dimensions. |
| SOIC-8 | 8 | 8 numbered contacts. See the individual package drawings for footprint dimensions. |
| TSSOP-8 | 8 | 8 numbered contacts. See the individual package drawings for footprint dimensions. |
| QFN/MLF-20 | 21 | 20 numbered contacts. The underside pad appears below the contact map. See the individual package drawings for footprint dimensions. |
| Device | Flash | SRAM | EEPROM | Supply | Max clock | Temperature |
|---|---|---|---|---|---|---|
| ATtiny45 | 4 KiB | 256 B | 256 B | — | — | — |
| ATtiny45V-10PU | 4 KiB | 256 B | 256 B | 1.8–5.5 V | 10 MHz | -40 to +85 °C |
| ATtiny45-20PU | 4 KiB | 256 B | 256 B | 2.7–5.5 V | 20 MHz | -40 to +85 °C |
| ATtiny85 | 8 KiB | 512 B | 512 B | — | — | — |
| ATtiny85V-10PU | 8 KiB | 512 B | 512 B | 1.8–5.5 V | 10 MHz | -40 to +85 °C |
| ATtiny85-20PU | 8 KiB | 512 B | 512 B | 2.7–5.5 V | 20 MHz | -40 to +85 °C |
Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured. Alternate assignments: ADC0 (ADC), PCINT5 (EXINT).
Serial programming (ISP). Hold RESET (PB5) low during programming. The programmer drives MOSI into PB0 and SCK into PB2. PB1 drives MISO back to the programmer.
RESET, GPIO or ADC0 on PB5. RESET is active by default. GPIO use requires disabling RESET via RSTDISBL and keeping debugWIRE inactive. For ADC0, check the reset threshold and internal pull-up while RESET is enabled. Active debugWIRE also uses this pad.
Unused GPIO. Give unused GPIO inputs a defined level. Enable the internal pull-up or use an external pull-up or pull-down if a defined level is needed during reset. Avoid a direct rail connection that could short an accidental output.
| Pin | Signal | Direction | Function |
|---|---|---|---|
| 1 | PB5 Input / I/O | Input / I/O | Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured. Alternate assignments: ADC0 (ADC), PCINT5 (EXINT). |
| 2 | PB3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT3 (EXINT), OC1BINV (TC1). |
| 3 | PB4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC2 (ADC), PCINT4 (EXINT), OC1B (TC1). |
| 4 | GND Return | Return | Supply return. Connect every ground pin. |
| 5 | PB0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN0 (AC), AREF (ADC), SDA (USI), DI (USI), PCINT0 (EXINT), OC0A (TC0), OC1AINV (TC1). |
| 6 | PB1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN1 (AC), DO (USI), PCINT1 (EXINT), OC0B (TC0), OC1A (TC1). |
| 7 | PB2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC1 (ADC), SCL (USI), USCK (USI), PCINT2 (EXINT), INT0 (EXINT), T0 (TC0). |
| 8 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN1 → PB1 · AIN0 → PB0
Select the analog channel and reference in firmware. The reference choice and supply constrain the input range. ADC0 → PB5 · ADC1 → PB2 · ADC2 → PB4 · AREF → PB0
Firmware sets the Universal Serial Interface to two-wire or three-wire operation and handles protocol state. The programming interface has its own direction assignments. SDA → PB0 · SCL → PB2 · DI → PB0 · DO → PB1 · USCK → PB2
Review each signal assignment and the peripheral enable conditions in the data sheet. PCINT0 → PB0 · PCINT1 → PB1 · PCINT2 → PB2 · PCINT3 → PB3 · PCINT4 → PB4 · PCINT5 → PB5 · INT0 → PB2
Review each signal assignment and the peripheral enable conditions in the data sheet. T0 → PB2 · OC0B → PB1 · OC0A → PB0
Review each signal assignment and the peripheral enable conditions in the data sheet. OC1B → PB4 · OC1BINV → PB3 · OC1A → PB1 · OC1AINV → PB0
| Parameter | Limit | Conditions and source |
|---|---|---|
| Program flash8 KiB | 8 KiB | Nonvolatile program memory. 2586Q · Memory |
| SRAM512 B | 512 B | Volatile data and stack storage. 2586Q · Memory |
| EEPROM512 B | 512 B | Nonvolatile data storage. 2586Q · Memory |
| Clock and supplyOrder-code dependent | Order-code dependent | Use the grade table and the device’s speed-versus-voltage curve. 2586Q · Electrical Characteristics |
Each package lists the documented order codes and variants covered by this map. Select the marked model to see its peripheral assignments and memory. Check the exact order code and datasheet revision before laying out a PCB.