ATMEGA168-20AI - 8-bit AVR MCU 20MHz 16KB Flash | Microchip
MPN: ATMEGA168-20AI ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.85 | $2.85 |
| 10 | $2.56 | $25.60 |
| 100 | $2.2 | $220.00 |
| 500 | $2 | $1,000.00 |
| 1,000 | $1.85 | $1,850.00 |
ATMEGA168-20AI Overview
An 8-bit AVR microcontroller is a single-chip processor based on the AVR advanced RISC architecture, in which most of the 131 instructions execute in a single clock cycle. Within the power-management hierarchy, the ATmega168 family sits in the entry-to-mid MCU range between the ATmega48/88 and the pin-compatible ATmega328, offering an optimal balance of Flash density, peripherals, and cost.
Key features include 23 programmable I/O lines, two 8-bit and one 16-bit timer/counter with compare and PWM modes, an 8-channel 10-bit ADC, a serial programmable USART, a byte-oriented two-wire interface (I2C-compatible), an SPI serial interface, and debugWIRE on-chip debugging. Self-programming Flash with read-while-write support enables in-system programming (ISP) and boot-loader operation.
Architecturally, the device pairs a fast RISC CPU with 32 general-purpose working registers, all directly connected to the arithmetic logic unit, allowing two independent registers to be accessed in one instruction executed in one clock cycle. This Harvard-architecture design achieves up to 1 MIPS per MHz, permitting aggressive clock scaling for low-power battery designs.
Typical applications include industrial control and automation nodes, sensor acquisition systems using the 8-channel 10-bit ADC, consumer appliances, motor control with PWM outputs, and hobby/prototyping platforms compatible with the Arduino ecosystem.
A key design consideration: use the -AI speed-grade supply limits (2.7V to 5.5V at 20 MHz) and place 100 nF decoupling capacitors on each VCC/AVCC pin pair close to the TQFP-32 package pins.
This page synthesizes distributor inventory data, drop-in alternatives, and practical design notes beyond what the manufacturer datasheet alone provides.
Drop-in alternatives for ATMEGA168-20AI — same package, pin-to-pin compatible. Different-package parts requiring PCB rework are excluded.
Variants in this series
Same-series models that are drop-in compatible with ATMEGA168-20AI (same form factor and footprint) — differing in Operating Temperature, Serial Interfaces, Timers/Counters, Package, EEPROM.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
ATMEGA168-20AU
✅ Drop-In✓ In Stock
$1.82 / Unit
View Datasheet →ATMEGA168A-AU
✅ Drop-In✓ In Stock
$1.42 / Unit
View Datasheet →ATMEGA168PA-AU
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$0.98 / Unit
View Datasheet →ATMEGA328P-AU
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$1.9 / Unit
View Datasheet →ATMEGA168-20AI Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit AVR RISC |
| Maximum Clock Frequency | 20 MHz |
| Flash Memory | 16 KB (8K x 16) |
| SRAM | 1 KB |
| EEPROM | 512 B |
| Supply Voltage Range | 2.7 V to 5.5 V |
| Operating Temperature | -40C to +85C (industrial) |
| I/O Lines | 23 |
| ADC Resolution | 10-bit |
| ADC Channels | 8 |
| Timers/Counters | 2 x 8-bit, 1 x 16-bit |
| Communication Interfaces | USART, SPI, 2-wire (I2C-compatible) |
| Package | 32-TQFP (7x7 mm) |
| Mounting Type | Surface Mount |
| Throughput | Up to 20 MIPS at 20 MHz |
| Instructions | 131 instructions, most single-cycle |
| On-chip Debug | debugWIRE |
| Programming | ISP (In-System Programming), self-programming Flash |
ATMEGA168-20AI Pin Configuration
| Pin 1 | PD3 — Port D bit 3 / INT1 / OC2B / PCINT19 |
| Pin 2 | PD4 — Port D bit 4 / XCK / T0 / PCINT20 |
| Pin 3 | GND — Ground |
| Pin 4 | VCC — Digital supply voltage |
| Pin 5 | GND — Ground |
| Pin 6 | VCC — Digital supply voltage |
| Pin 7 | PB6 — Port B bit 6 / XTAL1 / TOSC1 / PCINT6 |
| Pin 8 | PB7 — Port B bit 7 / XTAL2 / TOSC2 / PCINT7 |
| Pin 9 | PD5 — Port D bit 5 / T1 / OC0B / PCINT21 |
| Pin 10 | PD6 — Port D bit 6 / AIN0 / OC0A / PCINT22 |
| Pin 11 | PD7 — Port D bit 7 / AIN1 / PCINT23 |
| Pin 12 | PB0 — Port B bit 0 / ICP1 / CLKO / PCINT0 |
| Pin 13 | PB1 — Port B bit 1 / OC1A / PCINT1 |
| Pin 14 | PB2 — Port B bit 2 / SS / OC1B / PCINT2 |
| Pin 15 | PB3 — Port B bit 3 / MOSI / OC2A / PCINT3 |
| Pin 16 | PB4 — Port B bit 4 / MISO / PCINT4 |
| Pin 17 | PB5 — Port B bit 5 / SCK / PCINT5 |
| Pin 18 | AVCC — Analog supply voltage for ADC |
| Pin 19 | ADC6 — Analog input channel 6 |
| Pin 20 | AREF — Analog reference voltage for ADC |
| Pin 21 | GND — Ground |
| Pin 22 | ADC7 — Analog input channel 7 |
| Pin 23 | PC0 — Port C bit 0 / ADC8 / PCINT8 |
| Pin 24 | PC1 — Port C bit 1 / ADC9 / PCINT9 |
| Pin 25 | PC2 — Port C bit 2 / ADC10 / PCINT10 |
| Pin 26 | PC3 — Port C bit 3 / ADC11 / PCINT11 |
| Pin 27 | PC4 — Port C bit 4 / ADC12 / SDA / PCINT12 |
| Pin 28 | PC5 — Port C bit 5 / ADC13 / SCL / PCINT13 |
| Pin 29 | PC6 — Port C bit 6 / RESET (active low, also debugWIRE) |
| Pin 30 | PD0 — Port D bit 0 / RXD / PCINT16 |
| Pin 31 | PD1 — Port D bit 1 / TXD / PCINT17 |
| Pin 32 | PD2 — Port D bit 2 / INT0 / PCINT18 |
Typical Applications
ATMEGA168-20AI is suitable for 6 applications: Industrial Control and Automation, Sensor Acquisition Systems, Motor Control with PWM, Embedded Networking and Communication Nodes, Consumer Appliances and White Goods, Hobby, Education, and Prototyping Platforms.
Industrial Control and Automation
The ATMEGA168-20AI fits industrial control nodes because its -AI industrial grade covers -40C to +85C and its 2.7V to 5.5V supply tolerates noisy 5V factory rails. Its 23 I/O lines drive relays, indicators, and opto-isolated inputs, while the 16-bit timer with PWM and compare modes handles motor speed control or valve actuation at up to 20 MIPS, leaving ample CPU margin for state machines and communication. The watchdog timer and brown-out detector support autonomous recovery in unattended equipment. The USART connects to RS-485 transceivers for Modbus RTU nodes, and the two-wire interface links local expansion I2C peripherals. Cost per node is a decisive advantage over 32-bit MCUs in high-volume sensor and actuator endpoints.
Recommended
Sensor Acquisition Systems
The 8-channel 10-bit ADC is the headline fit for sensor acquisition designs: with up to 8 multiplexed analog inputs, an internal reference option, and a 15 ksps-class conversion capability, one ATMEGA168-20AI digitizes thermistors, potentiometers, and 0-5V sensor outputs without an external ADC. AVCC and AREF pins on the 32-TQFP allow clean analog supply filtering for better effective resolution, and ADC6/ADC7 provide extra dedicated analog channels. The 512B EEPROM stores per-unit calibration constants across power cycles, while the USART streams results to a host or logs to external SPI memory. Running the core at reduced clock speeds leverages the 1 MIPS/MHz efficiency for battery-powered dataloggers that still need industrial temperature range.
Recommended
Motor Control with PWM
Motor control benefits from the ATMEGA168-20AI's three timers: the 16-bit Timer/Counter1 and the 8-bit Timer/Counter2 each offer PWM modes with output-compare pins, generating phase-correct or fast PWM for DC motor drivers and hobby servo control at typical 20 MHz resolution. The output-compare interrupts support closed-loop speed regulation using encoder feedback captured on external interrupt pins INT0/INT1. Dead-time generation for simple H-bridge drive can be implemented in firmware with single-cycle instruction timing. Industrial-grade temperature rating keeps PWM timing stable in enclosures up to +85C. Design consideration: at 5V the I/O can source/sink around 20 mA per pin, so a MOSFET gate driver is required between the MCU and any substantial motor stage.
Recommended
Embedded Networking and Communication Nodes
For communication nodes, the ATMEGA168-20AI integrates a serial programmable USART with hardware flow control support, an SPI master/slave interface, and a byte-oriented two-wire (I2C-compatible) interface with address recognition and wake-on-address. This combination lets a single 32-TQFP chip bridge field buses: USART to RS-485/RS-232 transceivers, SPI to Ethernet or CAN expansion controllers, and I2C to local sensors and EEPROMs. The 16KB Flash accommodates protocol stacks such as Modbus RTU or lightweight mesh firmware with boot-loader space to spare via self-programming Flash. debugWIRE allows single-wire in-circuit debugging through the RESET line, cutting development time on densely wired communication boards.
Recommended
Consumer Appliances and White Goods
Consumer appliance control boards use the ATMEGA168-20AI for its combination of low cost, 5V noise immunity, and adequate peripherals: timer PWM dims displays and drives buzzers, the ADC reads temperature sensors and user potentiometers, and the EEPROM remembers user settings through power loss. The 7x7 mm TQFP-32 suits compact single-PCB appliance layouts, and the industrial temperature rating provides margin above the +70C commercial ceiling found inside enclosures near heat sources. Power-managed modes (idle, power-down) cut standby consumption to microamp levels to meet energy-efficiency targets. The vast ATmega168 codebase, Arduino compatibility, and long-lived second-source channels reduce sourcing and firmware maintenance risk over appliance production lifecycles.
Recommended
Hobby, Education, and Prototyping Platforms
The ATmega168 is a foundational hobbyist and education MCU: Arduino-compatible toolchains such as MiniCore support the whole ATmega48/88/168/328 family, so the ATMEGA168-20AI programs through standard AVR ISP programmers and boot-loaders without vendor lock-in. Its 1 MIPS/MHz RISC efficiency lets students grasp cycle-accurate behavior, and debugWIRE provides single-wire debugging with only a RESET-line connection - ideal for low-cost development kits. The 20 MHz full-speed rating at 5V gives headroom for timing-critical experiments like software-defined IR protocols or bit-banged video. Community documentation, abundant breakout boards, and pin-compatible upgrade paths to ATmega328P make it a low-risk platform for both classroom and product prototyping.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA168-20AI — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA168-20AU | ATMEGA168A-AU | ATMEGA168PA-AU | ATMEGA328P-AU |
|---|---|---|---|---|---|
| Package | 32-TQFP (7x7 mm) | 32-TQFP (7x7 mm) - same | 32-TQFP (7x7 mm) - same | 32-TQFP (7x7 mm) - same | 32-TQFP (7x7 mm) - same |
| Brand | Microchip Technology (Atmel) | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 16 KB | 16 KB | 16 KB | 16 KB | 32 KB |
| SRAM | 1 KB | 1 KB | 1 KB | 1 KB | 2 KB |
| EEPROM | 512 B | 512 B | 512 B | 512 B | 1 KB |
| Max Clock Frequency | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Supply Voltage Range | 2.7 V to 5.5 V | 2.7 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 5.5 V |
| Temperature Range | -40C to +85C (industrial) | 0C to +70C (commercial) | -40C to +85C (industrial) | -40C to +85C (industrial) | -40C to +85C (industrial) |
| Power Technology | Standard AVR | Standard AVR | Improved silicon | picoPower (sub-uA sleep) | picoPower (sub-uA sleep) |
Key Differentiators
- Industrial temperature grade in ordering code (vs ATMEGA168-20AU)
- Pin-compatible memory upgrade path (vs ATMEGA328P-AU)
- Lower cost than picoPower variants for non-battery designs (vs ATMEGA168PA-AU)
Design Notes
Place 100 nF ceramic decoupling capacitors at both VCC pins (4 and 6) and one at AVCC (pin 18) as close to the TQFP-32 pins as possible, with a solid ground return via the adjacent GND pins (3, 5, 21). Filter AVCC through a 10 uH inductor or low-pass RC network from VCC if ADC accuracy matters; connect AREF to a clean reference with a 100 nF capacitor to ground when using the external reference. Keep analog traces away from the XTAL lines at PB6/PB7.
Do not disable the SPIEN fuse accidentally via ISP, or SPI programming becomes locked out. Remember that PC6 is RESET only - it is not usable as a general I/O on this device. When using debugWIRE, RESET must be level-shifted correctly and the DWEN fuse set; removing DWEN requires a high-voltage parallel programmer. Also ensure the clock fuse settings match your physical crystal; selecting an external-clock fuse setting without a clock source can brick the board.
The 2.7V to 5.5V supply range permits full 20 MHz operation, but note that maximum speed grades depend on VCC: below the -20 speed grade threshold, reduce f_MAX accordingly when running at lower voltages. Estimated: at 5V with 20 mA per active I/O plus core current, typical total supply current remains in the tens of mA range; use the power-down sleep mode (microamp class) between sensor sampling events to extend battery life. Verify brown-out detector threshold against your supply rail tolerances.
Compliance Information
RoHS compliance per active Microchip production status; certificate details for this exact ordering code were not present in verified data - confirm on Microchip product page.