ATMEGA168P-20AN - 16KB Flash 20MHz AVR MCU | Microchip
MPN: ATMEGA168P-20AN ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.85 | $2.85 |
| 10 | $2.56 | $25.60 |
| 100 | $2.21 | $221.00 |
| 500 | $1.95 | $975.00 |
| 1,000 | $1.72 | $1,720.00 |
ATMEGA168P-20AN Overview
An 8-bit microcontroller (MCU) is a complete computing system on a single chip, combining a processor core, program memory, data memory, and peripherals such as timers, UART, SPI, I2C, and ADC. MCUs form the lowest layer of the embedded systems hierarchy - sitting below application processors and above discrete logic - and are the workhorses of consumer, industrial, and automotive electronics.
Key features of the ATMEGA168P include 131 powerful RISC instructions with mostly single-cycle execution, 32 general-purpose working registers, a 10-bit ADC, three flexible timers/counters with compare modes, and in-system programmable Flash with read-while-write capability. The picoPower technology delivers low sleep-mode currents, making it suited to battery-powered designs.
Architecturally, the AVR core uses a Harvard structure with separate program and data buses, achieving one MIPS per MHz. The picoPower process node reduces static leakage, and brown-out detection, power-on reset, and an internal calibrated RC oscillator reduce external component count.
Typical applications include Arduino-compatible boards, industrial sensors and control nodes, motor control, consumer appliances, and battery-powered instrumentation. The 20 MHz speed grade supports demanding polling and interrupt workloads.
Design consideration: operate from a 2.7 V to 5.5 V supply; at 5 V the full 20 MHz is available, but at lower voltages the maximum clock frequency is derated per the datasheet frequency-versus-voltage curve.
This page synthesizes drop-in alternatives, pricing context, and practical design notes not found in the manufacturer datasheet, giving engineers a single citable reference.
Drop-in alternatives for ATMEGA168P-20AN — 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 ATMEGA168P-20AN (same form factor and footprint) — differing in Package, Throughput, EEPROM, ADC, Instruction Set.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
ATMEGA328P-AU
✅ Drop-In✓ In Stock
$1.9 / Unit
View Datasheet →ATMEGA168PA-ANR
✅ Drop-In✓ In Stock
$1.44 / Unit
View Datasheet →ATMEGA168-20AU
✅ Drop-In✓ In Stock
$1.82 / Unit
View Datasheet →ATMEGA165PA-AU
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$2.05 / Unit
View Datasheet →ATMEGA165A-AU
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$3.47 / Unit
View Datasheet →ATMEGA168P-20AN Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit AVR RISC |
| Flash Program Memory | 16 KB (8K x 16) ISP Flash |
| EEPROM | 512 B |
| SRAM | 1 KB |
| Maximum Clock Frequency | 20 MHz |
| Throughput | Up to 20 MIPS (1 MIPS/MHz) |
| Supply Voltage Range | 2.7 V to 5.5 V |
| General Purpose I/O | 23 lines |
| Working Registers | 32 x 8-bit |
| Instructions | 131 instructions, most single-cycle |
| Package | 32-TQFP (7x7 mm) |
| Mounting Type | Surface Mount |
| Temperature Grade | Industrial |
| Terminal Form | Gull Wing |
| Series | AVR ATmega, picoPower |
| Programming | In-System Programmable (ICSP), read-while-write |
ATMEGA168P-20AN Pin Configuration
| Pin 1 | PD3 — Port D bit 3 (GPIO / OC2B PWM output) |
| Pin 2 | PD4 — Port D bit 4 (GPIO / XCK / T0) |
| 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 - crystal input) |
| Pin 8 | PB7 — Port B bit 7 (XTAL2 / TOSC2 - crystal output) |
| Pin 9 | PD5 — Port D bit 5 (GPIO / OC0B / T1) |
| Pin 10 | PD6 — Port D bit 6 (GPIO / OC0A / AIN0) |
| Pin 11 | PD7 — Port D bit 7 (GPIO / AIN1) |
| Pin 12 | PB0 — Port B bit 0 (GPIO / XCK / T0 / CLKO) |
| Pin 13 | PB1 — Port B bit 1 (GPIO / OC1A) |
| Pin 14 | PB2 — Port B bit 2 (GPIO / SS / OC1B) |
| Pin 15 | PB3 — Port B bit 3 (GPIO / MOSI / OC2A) |
| Pin 16 | PB4 — Port B bit 4 (GPIO / MISO) |
| Pin 17 | PB5 — Port B bit 5 (GPIO / SCK) |
| Pin 18 | AVCC — ADC supply voltage (connect to VCC) |
| Pin 19 | ADC6 — ADC input channel 6 (TQFP-only pin) |
| Pin 20 | AREF — ADC analog reference |
| Pin 21 | GND — Ground |
| Pin 22 | ADC7 — ADC input channel 7 (TQFP-only pin) |
| Pin 23 | PC0 — Port C bit 0 (GPIO / ADC0) |
| Pin 24 | PC1 — Port C bit 1 (GPIO / ADC1) |
| Pin 25 | PC2 — Port C bit 2 (GPIO / ADC2) |
| Pin 26 | PC3 — Port C bit 3 (GPIO / ADC3) |
| Pin 27 | PC4 — Port C bit 4 (GPIO / ADC4 / SDA) |
| Pin 28 | PC5 — Port C bit 5 (GPIO / ADC5 / SCL) |
| Pin 29 | PC6 — Port C bit 6 (RESET - active low reset) |
| Pin 30 | PD0 — Port D bit 0 (GPIO / RXD - UART receive) |
| Pin 31 | PD1 — Port D bit 1 (GPIO / TXD - UART transmit) |
| Pin 32 | PD2 — Port D bit 2 (GPIO / INT0 external interrupt) |
Typical Applications
ATMEGA168P-20AN is suitable for 6 applications: Arduino-Compatible Boards, Industrial Sensor Nodes, Motor Control, Battery-Powered Consumer Devices, Embedded Instrumentation and Test Fixtures, IoT Edge Nodes.
Arduino-Compatible Boards
The ATmega168 family is the historical foundation of Arduino-class open hardware, and the ATMEGA168P-20AN drops directly into 32-TQFP Arduino-compatible layouts. Its 16 KB ISP Flash with read-while-write supports bootloaders such as Optiboot, while the 10-bit ADC, hardware UART, SPI, and I2C map directly onto the Arduino core API. Running at 20 MHz from a 5 V rail gives 20 MIPS of headroom for sketches with serial communication, sensor polling, and PWM output on up to six channels. The internal 8 MHz RC oscillator allows crystal-less boards for cost-sensitive designs, and ICSP programming requires only a reset line and two I/O pins via the MPLAB SNAP or compatible programmers.
Recommended
Industrial Sensor Nodes
In factory automation and process monitoring, the ATMEGA168P-20AN serves as a compact acquisition controller: the 10-bit ADC digitizes transducer outputs through AVCC/AREF-referenced inputs, while hardware I2C and SPI interface external precision converters or memory. The industrial temperature grade and 2.7 V to 5.5 V supply tolerate noisy 24 V-system environments when paired with a regulator and transient protection. picoPower sleep modes let the node idle at microamp levels between timed wake-ups via watchdog or timer interrupts, extending battery life in wireless retrofit sensors. The 23 GPIO lines drive status LEDs, relays through drivers, and 4-20 mA transmitter circuitry, and its 16 KB Flash comfortably holds protocol stacks such as Modbus RTU over the UART.
Recommended
Motor Control
The ATMEGA168P-20AN generates PWM for small DC and stepper motor control using its three timers with compare modes and output-compare pins. At 20 MHz, an 8-bit PWM at 20 kHz or phase-correct modes at audible-free frequencies are achievable, and the input-capture unit measures tachometer feedback periods for closed-loop speed regulation. The 10-bit ADC reads current-sense shunt amplifiers and potentiometer setpoints; interrupts at 20 MIPS throughput keep control loops deterministic. Designs typically pair the MCU with an H-bridge or gate driver, with the 5 V industrial-rated MCU supervising 12-24 V power stages. Brown-out detection protects flash integrity during supply sag from motor inrush, a common failure mode in cost-sensitive appliance motor boards.
Recommended
Battery-Powered Consumer Devices
picoPower technology makes the ATMEGA168P-20AN a strong fit for coin-cell and single-cell products such as remote controls, timers, kitchen appliances, and portable meters. Power-down and power-save sleep modes cut static current dramatically versus the non-P ATmega168 silicon, and the watchdog oscillator provides wake sources without an external 32 kHz crystal. The internal RC oscillator runs the core during active phases, allowing boards with zero timing crystals, reducing BOM cost and assembly steps. Firmware strategy - sleeping between button presses or measurement events with ADC disabled - typically yields multi-year battery life. The 512 B EEPROM stores calibration and user settings through power cycles, and the 32-TQFP package suits compact consumer PCBs.
Recommended
Embedded Instrumentation and Test Fixtures
Bench instruments, calibrators, and production test fixtures frequently use the ATMEGA168P-20AN as the supervisory MCU: the UART talks to a host PC or display module, SPI drives DACs and digitizers, and the 10-bit ADC handles coarse monitoring. One MIPS per MHz ensures responsive menu-driven user interfaces on character LCDs via parallel or I2C buses. The 16 KB Flash holds both application and bootloader, enabling field firmware updates over the serial port without external programmers on deployed fixtures. For setups requiring on-chip debug, hardware JTAG variants like the ATMEGA165PA in the same footprint allow in-circuit debugging via MPLAB SNAP, then production units revert to the ATMEGA168P for cost, since the pinout is preserved.
Recommended
IoT Edge Nodes
As a low-cost edge controller, the ATMEGA168P-20AN pairs with radio modules over UART or SPI to form sensor-to-cloud nodes. The MCU aggregates analog and digital sensor inputs, applies threshold logic in its 16 KB Flash, and forwards compact payloads to a transceiver, staying in power-save sleep between radio events. Hardware I2C reads environmental sensors, while the ADC monitors battery voltage through a divider for low-battery alerts. The 2.7 V floor allows direct operation from two alkaline cells or a single LiFePO4 cell through a small LDO. Brown-out detection and EEPROM wear management preserve configuration across outages. Typical designs target sub-GHz or proprietary 2.4 GHz links where full TCP/IP stacks are unnecessary.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA168P-20AN — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA328P-AU | ATMEGA168PA-ANR | ATMEGA168-20AU | ATMEGA165PA-AU | ATMEGA165A-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 | 32-TQFP (7x7 mm) - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 16 KB | 32 KB | 16 KB | 16 KB | 16 KB | 16 KB |
| SRAM | 1 KB | 2 KB | 1 KB | 1 KB | 1 KB | 1 KB |
| EEPROM | 512 B | 1 KB | 512 B | 512 B | 512 B | 512 B |
| Max Clock Speed | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 16 MHz | 16 MHz |
| Supply Voltage | 2.7 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 5.5 V | 2.7 V to 5.5 V | 1.8 V to 5.5 V | 2.7 V to 5.5 V |
| Hardware Debug Interface | debugWIRE (via RESET pin) | debugWIRE | debugWIRE | debugWIRE | JTAG + debugWIRE | JTAG |
Key Differentiators
- Lowest cost within the 16 KB picoPower family (vs ATMEGA328P-AU)
- Improved picoPower silicon vs legacy ATmega168 (vs ATMEGA168-20AU)
- TQFP-32 adds ADC6/ADC7 channels over DIP-28 siblings (vs ATMEGA168PA-ANR (DIP variants))
Design Notes
Connect both VCC pins (4 and 6) and AVCC (pin 18) to the same regulated rail, each with a 100 nF ceramic decoupling capacitor placed within 5 mm of the pin, plus one 4.7-10 uF bulk capacitor per board section. AVCC must never float - the datasheet requires connecting it to VCC even when the ADC is unused, or the ADC and port C behavior becomes unreliable. For 3.3 V designs, note the P and PA variants allow 1.8 V operation, but the ATMEGA168P-20AN floor is 2.7 V per distributor specification data.
Keep the crystal (if used on PB6/PB7) within 10 mm of the MCU with 20 pF-class load capacitors to ground and a ground guard ring; long crystal traces pick up noise and cause start-up failures at 20 MHz. Route the RESET line (PC6, pin 29) short and add a 10 kOhm pull-up; if a reset supervisor is used, verify its pulse width meets the datasheet minimum reset duration. Provide an ICSP header (MOSI, MISO, SCK, RESET, VCC, GND) in every production layout for field reprogramming.
Do not exceed the frequency-versus-voltage safe operating region: full 20 MHz operation requires a supply near 5 V, while at 3.3 V the safe maximum is roughly 13-14 MHz per the AVR family datasheet derating curve - overclocking at low voltage produces random flash corruption. Also remember PC6 doubles as RESET, not a general-purpose I/O, unless the RESET fuse is deliberately disabled (which bricks ICSP access). Finally, EEPROM writes wear at approximately 100k cycles - do not log data to EEPROM in tight loops.
Compliance Information
Compliance data was not present in the verified web data for this MPN; verify on the official Microchip product page or distributor compliance reports before export-controlled shipments.