ATMEGA164P-20AQ - 16KB Flash 8-bit AVR MCU 20MHz TQFP-44 | Microchip
MPN: ATMEGA164P-20AQ β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $4.62 | $4.62 |
| 10 | $4.15 | $41.50 |
| 100 | $3.66 | $366.00 |
| 500 | $3.31 | $1,655.00 |
| 1,000 | $2.94 | $2,940.00 |
ATMEGA164P-20AQ Overview
An 8-bit AVR microcontroller is a Harvard-architecture RISC processor in which flash program memory, SRAM data memory, and I/O peripherals each occupy separate address spaces, allowing most instructions to execute in a single clock cycle. Within the power-management hierarchy, the ATmega family sits between tinyAVR devices and the larger ATmega128x parts, offering 32 general-purpose I/O lines, 32 general-purpose working registers, and a full peripheral set including UART, SPI, and TWI (I2C) serial interfaces.
Key differentiating features include picoPower technology for ultra-low power consumption, read-while-write flash for in-system self-programming, 131 powerful RISC instructions with mostly single-cycle execution delivering up to 20 MIPS throughput at 20 MHz, and two flexible 8-bit/16-bit timers with PWM outputs. An 8-channel 10-bit ADC, analog comparator, programmable watchdog timer with separate on-chip oscillator, and on-chip debug capability via debugWIRE complete the peripheral set.
The picoPower process technology reduces standby currents dramatically: power-down mode consumption is far below standard ATmega parts, making the P-suffix devices suited to battery-powered designs. The extended-temperature (AQ) suffix and green/RoHS packaging suit industrial deployments.
Typical applications include industrial automation nodes, battery-powered metering and sensor transmitters, motor control interfaces, and embedded communication gateways where 16 KB of code space, rich I/O, and low standby current are required.
A key design consideration: the low-frequency crystal oscillator is optimized for very low power and has reduced driver strength compared with ATmega16/32, so crystal load capacitance and ESR must be carefully selected when migrating designs (see Atmel/Microchip application note AVR505).
This page synthesizes distributor pricing, pin-to-pin drop-in alternatives across the ATmega164/324/644 family, and practical migration design notes not consolidated in the manufacturer datasheet.
Drop-in alternatives for ATMEGA164P-20AQ β 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 ATMEGA164P-20AQ (same form factor and footprint) β differing in ADC, General Purpose I/O, Instruction Set, Operating Temperature, Package.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
ATMEGA164P-20AU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA164A-MU
β Drop-Inβ In Stock
$3.01 / Unit
View Datasheet βATMEGA324P-20AU
β Drop-In β οΈ εζ°εΎ ιͺθ―π Reference alternative (not in catalog)
ATMEGA644-20AU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA644PA-AU
β Drop-In β οΈ εζ°εΎ ιͺθ―π Reference alternative (not in catalog)
ATMEGA16A-AU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA164P-20AQ Maximum Ratings & Electrical Characteristics
| Core Architecture | AVR 8-bit RISC |
| Flash Memory | 16 KB (8K x 16) ISP, read-while-write |
| EEPROM | 512 B |
| SRAM | 1 KB |
| Maximum CPU Speed | 20 MHz |
| Supply Voltage Range | 2.7 V to 5.5 V |
| General Purpose I/O | 32 lines |
| General Purpose Working Registers | 32 |
| Instruction Set | 131 instructions, mostly single-cycle |
| MIPS Throughput | Up to 20 MIPS at 20 MHz |
| Package | 44-TQFP (10 x 10 mm) |
| Operating Temperature | -40C to +85C (extended, A suffix) |
| ADC | 10-bit, 8 channels |
| Serial Interfaces | USART, SPI, TWI (I2C) |
| Low Power Technology | picoPower |
| Watchdog Timer | Programmable WDT with separate oscillator |
| RoHS Status | Compliant (green package) |
| Mounting Type | Surface Mount |
ATMEGA164P-20AQ Pin Configuration
| Pin 1 | PA0 (ADC0) β Port A bit 0 / ADC channel 0 |
| Pin 2 | PA1 (ADC1) β Port A bit 1 / ADC channel 1 |
| Pin 3 | PA2 (ADC2) β Port A bit 2 / ADC channel 2 |
| Pin 4 | PA3 (ADC3) β Port A bit 3 / ADC channel 3 |
| Pin 5 | PA4 (ADC4) β Port A bit 4 / ADC channel 4 |
| Pin 6 | PA5 (ADC5) β Port A bit 5 / ADC channel 5 |
| Pin 7 | PA6 (ADC6) β Port A bit 6 / ADC channel 6 |
| Pin 8 | PA7 (ADC7) β Port A bit 7 / ADC channel 7 |
| Pin 9 | PB0 (XCK0/T0) β Port B bit 0 / USART0 external clock / Timer0 clock input |
| Pin 10 | PB1 (T1) β Port B bit 1 / Timer1 external clock input |
| Pin 11 | PB2 (AIN0/INT2) β Port B bit 2 / Analog comparator positive input / External interrupt 2 |
| Pin 12 | PB3 (AIN1/OC0) β Port B bit 3 / Analog comparator negative input / Timer0 output compare |
| Pin 13 | PB4 (SS) β Port B bit 4 / SPI slave select |
| Pin 14 | PB5 (MOSI) β Port B bit 5 / SPI master output slave input |
| Pin 15 | PB6 (MISO) β Port B bit 6 / SPI master input slave output |
| Pin 16 | PB7 (SCK) β Port B bit 7 / SPI serial clock |
| Pin 17 | NC β Not connected (per datasheet) |
| Pin 18 | VCC β Digital supply voltage |
| Pin 19 | GND β Ground |
| Pin 20 | NC β Not connected (per datasheet) |
| Pin 21 | PC0 (SCL) β Port C bit 0 / TWI serial clock |
| Pin 22 | PC1 (SDA) β Port C bit 1 / TWI serial data |
| Pin 23 | PC2 (TCK) β Port C bit 2 / JTAG test clock |
| Pin 24 | PC3 (TMS) β Port C bit 3 / JTAG test mode select |
| Pin 25 | PC4 (TDO) β Port C bit 4 / JTAG test data output |
| Pin 26 | PC5 (TDI) β Port C bit 5 / JTAG test data input |
| Pin 27 | PC6 (TOSC1) β Port C bit 6 / Timer oscillator input 1 |
| Pin 28 | PC7 (TOSC2) β Port C bit 7 / Timer oscillator output 2 |
| Pin 29 | PD7 (OC2) β Port D bit 7 / Timer2 output compare |
| Pin 30 | PD6 (ICP1) β Port D bit 6 / Timer1 input capture |
| Pin 31 | PD5 (OC1A) β Port D bit 5 / Timer1 output compare A |
| Pin 32 | PD4 (OC1B/XCK1) β Port D bit 4 / Timer1 output compare B / USART1 clock |
| Pin 33 | PD3 (INT1/TXD1) β Port D bit 3 / External interrupt 1 / USART1 transmit |
| Pin 34 | PD2 (INT0/RXD1) β Port D bit 2 / External interrupt 0 / USART1 receive |
| Pin 35 | PD1 (TXD0) β Port D bit 1 / USART0 transmit |
| Pin 36 | PD0 (RXD0) β Port D bit 0 / USART0 receive |
| Pin 37 | /RESET β Reset input (active low) |
| Pin 38 | VCC β Digital supply voltage |
| Pin 39 | GND β Ground |
| Pin 40 | XTAL2 β System crystal oscillator output |
| Pin 41 | XTAL1 β System crystal oscillator input |
| Pin 42 | AREF β ADC analog reference voltage |
| Pin 43 | AVCC β ADC supply voltage |
| Pin 44 | AGND β ADC analog ground |
Typical Applications
ATMEGA164P-20AQ is suitable for 6 applications: Industrial Automation Nodes, Battery-Powered Metering and Sensing, Embedded Communication Gateways, Motor Control Interfaces, Consumer Embedded Products, Test and Measurement Instrumentation.
Industrial Automation Nodes
The ATMEGA164P-20AQ fits industrial automation and control nodes because its extended -40C to +85C operating range, green industrial-grade packaging, and robust AVR core at up to 20 MIPS handle factory-floor temperature swings and real-time control loops. Its 32 GPIO lines, USART, SPI, and TWI interfaces let one MCU drive sensors, actuators, and an RS-485 or Modbus-over-UART link simultaneously, while the 10-bit ADC digitizes analog process signals with 1024-step resolution. The programmable watchdog timer with a separate on-chip oscillator provides autonomous fault recovery in unattended installations. Running from a 2.7 V to 5.5 V rail, it tolerates noisy 5 V industrial supplies without an external regulator change, and 16 KB of flash accommodates Modbus stacks plus control logic with bootloader headroom for field firmware updates.
Recommended
Battery-Powered Metering and Sensing
The picoPower technology of the ATMEGA164P-20AQ makes it a strong choice for battery-powered meters, dataloggers, and wireless sensor transmitters. Power-down standby current is dramatically lower than standard ATmega parts, and the low-frequency crystal oscillator is specifically optimized for very low power timekeeping in sleep-based duty-cycling designs. The 10-bit ADC samples analog sensors across 8 channels, and the 512 B EEPROM stores calibration constants that survive battery replacement. The wide 2.7 V supply floor means the MCU runs directly from two alkaline cells or a 3 V lithium coin cell without a boost converter. A typical duty-cycle design sleeps in power-down, wakes on watchdog or pin interrupt, measures via ADC, and transmits over USART - the 16 KB flash comfortably hosts this state machine plus a full communication stack.
Recommended
Embedded Communication Gateways
The ATMEGA164P-20AQ serves protocol-conversion gateways where UART, SPI, and TWI traffic must be bridged. The AVR core executes most of its 131 instructions in a single clock cycle, sustaining 20 MIPS at 20 MHz - sufficient to service dual-context UART buffering, SPI slave emulation, and TWI master polling concurrently with interrupt-driven state machines. The 1 KB SRAM buffers packet frames, and read-while-write flash allows a bootloader to rewrite application firmware over the communication link without halting the running program, enabling remote field updates of deployed gateways. Board designers benefit from the 44-TQFP footprint shared across the ATmega164/324/644 family: when traffic volumes grow beyond 16 KB of code, the same PCB accepts an ATMEGA644-20AU with four times the memory and no layout change.
Recommended
Motor Control Interfaces
The ATMEGA164P-20AQ supports small motor control and drive-interface applications through its timer units, which generate multiple PWM channels at hardware level with no CPU load. The 8-bit timers deliver fast PWM suitable for DC motor speed control, while the 16-bit timer provides phase- and frequency-correct PWM for servo and stepper Applications requiring precise pulse widths. The 10-bit ADC reads current-sense shunt voltages or back-EMF feedback for closed-loop speed regulation, and the analog comparator supports zero-crossing detection in sensorless brushless designs. Operating at 5 V with 20 MHz clocking gives 50 ns timer resolution for fine PWM granularity. The extended temperature grade ensures reliable operation inside enclosed drive enclosures where ambient temperatures approach the upper -40C to +85C limit.
Recommended
Consumer Embedded Products
In consumer products such as small appliances, thermostats, remote controls, and toys, the ATMEGA164P-20AQ balances cost and capability. The 44-pin TQFP-44 (10x10 mm) package suits compact two-layer boards, and 32 GPIO lines drive keypads, LED segments, and relays directly at 5 V logic levels. The TWI interface manages capacitive-touch controllers or RTC chips, while the USART serves as a debug or PC-communication port. picoPower modes extend battery life in handheld products, and the green RoHS-compliant package simplifies global regulatory compliance for consumer shipments. With 16 KB of flash, the firmware for a menu-driven user interface plus communication logic fits comfortably, and the family's wide code-footprint pin compatibility (164P/324P/644P) lets product SKUs share one PCB with different memory options for feature tiers.
Recommended
Test and Measurement Instrumentation
The ATMEGA164P-20AQ is well suited to embedded roles within bench-top and handheld test instruments: front-panel control, data acquisition front-ends, and sensor calibration subsystems. The 10-bit ADC with 8 multiplexed channels digitizes probe inputs or auxiliary sensors, and the analog comparator supports threshold-event capture. Precise timing derives from the 16-bit timer clocked by the 20 MHz system clock or an external crystal on XTAL1/XTAL2. The 512 B EEPROM holds factory calibration tables that survive power cycles, and the TWI bus reads out external precision ADCs or reference chips when 10-bit resolution is insufficient. The extended temperature grade supports instruments used outdoors or in environmental chambers, and in-circuit debugging via MPLAB SNAP shortens firmware iteration during instrument development.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA164P-20AQ β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA164P-20AU | ATMEGA164A-MU | ATMEGA324P-20AU | ATMEGA644-20AU |
|---|---|---|---|---|---|
| Package | 44-TQFP (10x10 mm) | 44-TQFP - same | 44-TQFP - same | 44-TQFP - same | 44-TQFP - same |
| Brand | Microchip Technology (Atmel) | Microchip Technology (Atmel) | Microchip Technology (Atmel) | Microchip Technology (Atmel) | Microchip Technology (Atmel) |
| Flash Memory | 16 KB | 16 KB | 16 KB | 32 KB | 64 KB |
| SRAM | 1 KB | 1 KB | 1 KB | 2 KB | 2 KB |
| EEPROM | 512 B | 512 B | 512 B | 1 KB | 2 KB |
| Maximum CPU Speed | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Supply Voltage | 2.7 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 | 2.7 V to 5.5 V |
| Low Power Technology | picoPower (P-series) | picoPower (P-series) | picoPower A-series | picoPower (P-series) | Standard (non-picoPower) |
Key Differentiators
- picoPower low-power modes at same price class (vs ATMEGA16A-AU)
- Pin-compatible 4x memory upgrade path (vs ATMEGA324P-20AU)
- Lower cost than high-memory siblings (vs ATMEGA644-20AU)
- Active A-series successor for new designs (vs ATMEGA164A-MU)
Design Notes
Decouple both VCC pins (18 and 38) with 100 nF ceramic capacitors placed within 5 mm of each pin, plus one 10 uF bulk capacitor near the MCU. Connect AVCC (pin 43) to VCC through a low-pass LC filter (10 uH inductor with 100 nF) when ADC accuracy matters, and tie AREF (pin 42) to ground through a 100 nF capacitor when using the internal reference. Keep the analog ground return (AGND, pin 44) separate from switching-current returns and join at a single star point to protect ADC linearity.
When migrating from ATmega16/32 to the ATMEGA164P, remember that the low-frequency crystal oscillator for Timer2 is optimized for very low power and has reduced driver strength. Per Microchip application note AVR505 (doc8001), the crystal's load capacitance and ESR must be re-verified - a crystal selected for the ATmega16 may fail to start on the ATmega164P. Also confirm fuses for the extended fuse byte (BOD level) and the changed interrupt vector layout, since interrupt registers differ across the migration family.
Estimated: at 5 V and 20 MHz, an ATmega-class AVR draws roughly 10-12 mA active current, giving about 50-60 mW core dissipation plus I/O load (calculate as V x sum of pin currents, max 40 mA per pin, 200 mA total per datasheet absolute maximums). picoPower power-down modes cut this to microamp levels - enable BOD disable in sleep via fuse for lowest current. Size the 5 V supply for peak I/O switching current plus external loads, not just core consumption, and verify brown-out detection level is set above the minimum 2.7 V operating floor.
Keep the XTAL1/XTAL2 crystal traces (pins 41/40) under 10 mm, guard them with ground pour, and place the crystal's load capacitors directly at the pins. Route SPI clock (PB7) and USART lines away from the analog front end; series-terminate 22-33 ohm resistors on fast SPI clock edges if trace lengths exceed 50 mm to reduce ringing and radiated emissions. The TOSC1/TOSC2 32.768 kHz watch crystal on PC6/PC7 is especially sensitive - keep it short and isolated from digital switching loops.
Compliance Information
FindIC listing describes the ATMEGA164P-20AQ as GREEN packaging, indicating RoHS-compliant lead-free construction. REACH, halogen-free, and conflict minerals declarations should be confirmed via Microchip's official compliance documentation.