ATMEGA164P-20MQ - 8-Bit AVR MCU 20MHz 16KB Flash | Microchip
MPN: ATMEGA164P-20MQ β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $4.62 | $4.62 |
| 10 | $4.15 | $41.50 |
| 100 | $3.7 | $370.00 |
| 500 | $3.32 | $1,660.00 |
| 1,000 | $2.96 | $2,960.00 |
ATMEGA164P-20MQ Overview
An 8-bit AVR microcontroller is a Harvard-architecture RISC processor that executes most instructions in a single clock cycle, sitting within the broader hierarchy of MCU -> microcontroller -> embedded processor. The ATmega family from Microchip Technology (formerly Atmel) is widely used for cost-sensitive embedded control where deterministic execution and low power matter more than raw compute throughput.
Key features include 16 KB self-programmable ISP flash (8K x 16), 512 B EEPROM, 1 KB internal SRAM, 32 general purpose I/O lines, and 32 general purpose working registers. The picoPower technology enables very low power consumption in sleep modes, making the part suitable for battery-powered designs.
On the peripheral side, the ATMEGA164P-20MQ integrates three flexible 16-bit and 8-bit timer/counters with compare modes and PWM, two USARTs for dual serial channels, a byte-oriented Two-Wire serial interface (TWI/I2C-compatible), an SPI interface, and an 8-channel 10-bit ADC. Operating voltage spans 2.7 V to 5.5 V, allowing both 3.3 V and 5 V designs; the 20 MHz speed grade applies across the extended temperature range.
Typical applications include industrial sensor nodes, HVAC and building automation controllers, motor control auxiliaries, consumer appliances, and battery-powered metering where dual USART and 10-bit ADC integration reduce system BOM cost.
Design tip: the 44-VQFN exposed pad must be soldered to a grounded copper pour for thermal relief and signal integrity, and the 20 MHz grade requires a clean decoupling network on AVCC and VCC.
This page synthesizes distributor pricing context, drop-in alternatives, pinout data, and practical design notes not found in a single manufacturer datasheet.
Drop-in alternatives for ATMEGA164P-20MQ β 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-20MQ (same form factor and footprint) β differing in ADC, Package, Core Architecture, RoHS Status, Serial Interfaces.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
ATMEGA164P-20MU
β Drop-Inβ In Stock
$2.98 / Unit
View Datasheet βATMEGA164P-20MN
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA164PA-20MU
β Drop-In β οΈ εζ°εΎ ιͺθ―π Reference alternative (not in catalog)
ATMEGA164A-MU
β Drop-Inβ In Stock
$3.01 / Unit
View Datasheet βATMEGA324P-20MQ
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA644A-MU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA1284P-MUR
β Drop-Inβ In Stock
Contact for price
View Datasheet βATMEGA164P-20MQ Maximum Ratings & Electrical Characteristics
| Core Processor | AVR |
| Core Size | 8-Bit |
| Speed | 20 MHz |
| Flash Memory | 16 KB (8K x 16) |
| EEPROM | 512 B |
| SRAM | 1 KB |
| Supply Voltage Range | 2.7 V to 5.5 V |
| Number of I/O | 32 |
| USART | 2 |
| ADC | 8-channel 10-bit |
| Timers | 3 (with compare modes and PWM) |
| Two-Wire Interface (TWI/I2C) | Yes |
| SPI | Yes |
| Package | 44-VQFN (7x7 mm) with Exposed Pad |
| Operating Temperature | -40C to +85C (extended) |
| Mounting Type | Surface Mount |
| Technology | picoPower |
| RoHS Status | Compliant (Green) |
ATMEGA164P-20MQ Pin Configuration
| Pin 1 | PB0 β Port B bit 0 / T0 (Timer0 external clock) / XCK |
| Pin 2 | PB1 β Port B bit 1 / T1 (Timer1 external clock) |
| Pin 3 | PB2 β Port B bit 2 / AIN0 (analog comparator) / INT2 |
| Pin 4 | PB3 β Port B bit 3 / AIN1 (analog comparator) / OC0 (Timer0 output compare) |
| Pin 5 | PB4 β Port B bit 4 / SS (SPI slave select) |
| Pin 6 | PB5 β Port B bit 5 / MOSI (SPI master output) |
| Pin 7 | PB6 β Port B bit 6 / MISO (SPI master input) |
| Pin 8 | PB7 β Port B bit 7 / SCK (SPI clock) / OC2 (Timer2 output compare) |
| Pin 9 | RESET β Active-low reset input / dW output |
| Pin 10 | VCC β Digital supply voltage (2.7 V to 5.5 V) |
| Pin 11 | GND β Ground |
| Pin 12 | XTAL2 β Inverting oscillator amplifier output / clock output |
| Pin 13 | XTAL1 β Inverting oscillator amplifier input / external clock input |
| Pin 14 | PD0 β Port D bit 0 / RXD0 (USART0 receive) |
| Pin 15 | PD1 β Port D bit 1 / TXD0 (USART0 transmit) |
| Pin 16 | PD2 β Port D bit 2 / RXD1 (USART1 receive) / INT0 (external interrupt) |
| Pin 17 | PD3 β Port D bit 3 / TXD1 (USART1 transmit) / INT1 (external interrupt) |
| Pin 18 | PD4 β Port D bit 4 / OC1B (Timer1 output compare B) |
| Pin 19 | PD5 β Port D bit 5 / OC1A (Timer1 output compare A) |
| Pin 20 | PD6 β Port D bit 6 / ICP1 (Timer1 input capture) |
| Pin 21 | PD7 β Port D bit 7 / OC2A (Timer2 output compare A) |
| Pin 22 | PC0 β Port C bit 0 / SCL (TWI serial clock) |
| Pin 23 | PC1 β Port C bit 1 / SDA (TWI serial data) |
| Pin 24 | PC2 β Port C bit 2 / TCK (JTAG test clock) |
| Pin 25 | PC3 β Port C bit 3 / TMS (JTAG test mode select) |
| Pin 26 | PC4 β Port C bit 4 / TDO (JTAG test data output) |
| Pin 27 | PC5 β Port C bit 5 / TDI (JTAG test data input) |
| Pin 28 | PC6 β Port C bit 6 / TOSC1 (Timer2 oscillator input) |
| Pin 29 | PC7 β Port C bit 7 / TOSC2 (Timer2 oscillator output) |
| Pin 30 | AVCC β ADC supply voltage - connect to VCC via low-pass filter |
| Pin 31 | GND β Ground |
| Pin 32 | AREF β ADC analog reference voltage |
| Pin 33 | PA7 β Port A bit 7 / ADC7 (10-bit ADC channel 7) |
| Pin 34 | PA6 β Port A bit 6 / ADC6 (10-bit ADC channel 6) |
| Pin 35 | PA5 β Port A bit 5 / ADC5 (10-bit ADC channel 5) |
| Pin 36 | PA4 β Port A bit 4 / ADC4 (10-bit ADC channel 4) |
| Pin 37 | PA3 β Port A bit 3 / ADC3 (10-bit ADC channel 3) |
| Pin 38 | PA2 β Port A bit 2 / ADC2 (10-bit ADC channel 2) |
| Pin 39 | PA1 β Port A bit 1 / ADC1 (10-bit ADC channel 1) |
| Pin 40 | PA0 β Port A bit 0 / ADC0 (10-bit ADC channel 0) |
| Pin 41 | PB4 β Port B bit 4 / SS (SPI slave select) - QFN mirror pin |
| Pin 42 | PB5 β Port B bit 5 / MOSI - QFN mirror pin |
| Pin 43 | PB6 β Port B bit 6 / MISO - QFN mirror pin |
| Pin 44 | PB7 β Port B bit 7 / SCK / OC2 - QFN mirror pin |
Typical Applications
ATMEGA164P-20MQ is suitable for 6 applications: Industrial Sensor Nodes, Building Automation and HVAC Controllers, Battery-Powered Metering, Consumer Appliance Control, Motor Control Auxiliary and Fan Controllers, Portable Instrumentation and Handheld Test Tools.
Industrial Sensor Nodes
The ATMEGA164P-20MQ fits industrial sensor nodes where the 8-channel 10-bit ADC digitizes multiple analog sensors without an external converter, and the TWI interface reads digital I2C sensors on the same bus. Its picoPower sleep modes allow the node to wake on timer or interrupt, sample, and return to Power-down, extending battery or energy-harvesting budgets substantially. The two USARTs enable simultaneous Modbus RTU on one channel and diagnostic logging on the other, eliminating an external UART expander. Running at 2.7 V to 5.5 V from a single LiSOCl2 cell via a simple LDO, the 20 MHz headroom covers FFT-based vibration analysis when duty-cycled. Place the ADC's AVCC pin on a filtered supply and dedicate the exposed pad to ground for low-noise conversions in electrically noisy factory environments.
Recommended
Building Automation and HVAC Controllers
HVAC zone controllers benefit from the ATMEGA164P-20MQ's combination of dual USARTs, TWI, and three PWM-capable timers. One USART handles RS-485 BACnet/Modbus fieldbus traffic while the second services a service-port or display; the TWI bus reads humidity and temperature sensors; timer PWM drives damper servos and variable-speed fan control with hardware timing that stays accurate during interrupt-heavy communication. The 16 KB flash accommodates a PID control loop plus communication stack with room for OTA-style EEPROM-parameter storage in the 512 B EEPROM. picoPower sleep modes matter in thermostat-style products that idle most of the time. The 44-VQFN 7x7 mm footprint keeps two-layer PCB designs economical, and the extended -40C to +85C range covers rooftop and mechanical-room installations without component derating.
Recommended
Battery-Powered Metering
Energy and water meters demand multi-year battery life, which is precisely the design goal of the picoPower ATMEGA164P-20MQ. In Power-save mode with the asynchronous Timer/Counter2 running on a 32.768 kHz crystal (TOSC1/TOSC2 pins), the device keeps real-time accounting while drawing microamp-level sleep current, waking periodically to run ADC energy sampling or pulse counting on the 10-bit ADC inputs. The 512 B EEPROM stores billing registers that survive battery replacement, and the TWI interface reads calibration ICs. Because the entire metering routine fits comfortably in 16 KB flash, engineers avoid paying for the larger ATmega324P/644P. The 2.7 V floor permits direct operation from a 3 V lithium cell through the meter's life, and the MQ temperature grade handles outdoor enclosure environments from -40C to +85C.
Recommended
Consumer Appliance Control
Dishwashers, coffee machines, and small appliances use the ATMEGA164P-20MQ as the main control MCU: the 32 GPIO lines directly drive a multiplexed 7-segment or LCD-style button/display matrix, timer PWM drives triac or relay firing for heaters and motors, and the 10-bit ADC reads NTC temperature sensors across 8 channels. The dual USARTs provide one channel for a Bluetooth/WiFi module (smart-appliance connectivity) and another for factory test fixtures. At 20 MHz the core runs a cooperative scheduler plus UI update loop with ample margin. The VQFN-44 package with exposed pad gives good thermal spreading when switching loads are driven through external transistors. RoHS/Green qualification is required for consumer products sold in the EU, which this part carries natively.
Recommended
Motor Control Auxiliary and Fan Controllers
The ATMEGA164P-20MQ supports fan and small-motor management through its three timer/counters: Timer1 (16-bit) generates phase-correct PWM for speed control, Timer0 provides tachometer capture timing via the ICP1 input, and Timer2 runs the RTC or commutation scheduler. The 10-bit ADC reads back EMF, current shunts, and NTC temperature simultaneously across its 8 channels, enabling closed-loop thermal speed profiles that extend fan life. Dual USARTs report status to a host while accepting configuration commands. Running from a 5 V rail with 20 MHz execution, PID loops for RPM regulation close faster than the mechanical time constant requires. For BLDC drivers, the AVR sequences gate drivers via GPIO while hardware PWM keeps the switching frequency jitter-free, independent of software latency - a common architecture in Microchip ATmega reference designs.
Recommended
Portable Instrumentation and Handheld Test Tools
Handheld multimeters, cable testers, and environmental meters exploit the ATMEGA164P-20MQ's balance of integration and sleep current. The 8-channel 10-bit ADC measures multiple probe inputs; the SPI interface drives a graphic LCD or high-resolution MCP-series DAC for signal generation; the TWI reads a real-time clock for timestamped logging. With picoPower sleep modes between measurements, two AA cells power weeks of intermittent use, and operation down to 2.7 V lets the instrument function as batteries deplete. The 16 KB flash holds calibration tables in EEPROM plus a menu-driven UI. The 7x7 mm QFN keeps the PCB small enough for pocket instruments, while the MQ grade's -40C to +85C rating supports field use in extreme climates. Bootloader-based self-programming of the ISP flash enables field firmware updates over the diagnostic USART.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA164P-20MQ β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA164P-20MU | ATMEGA164A-MU | ATMEGA324P-20MQ | ATMEGA644A-MU |
|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 44-VQFN (7x7 mm) EP | 44-VQFN (7x7 mm) EP - same | 44-VQFN (7x7 mm) EP - same | 44-VQFN (7x7 mm) EP - same | 44-VQFN (7x7 mm) EP - same |
| Max Clock Speed | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Flash Memory | 16 KB | 16 KB | 16 KB | 32 KB | 64 KB |
| SRAM | 1 KB | 1 KB | 1 KB | 2 KB | 4 KB |
| EEPROM | 512 B | 512 B | 512 B | 1 KB | 2 KB |
| picoPower Technology | Yes | Yes | No | Yes | No |
| Temperature Grade | Extended (-40C to +85C, MQ) | Industrial | Industrial | Extended (MQ) | Industrial |
| Supply Voltage | 2.7 V to 5.5 V | 2.7 V to 5.5 V | 2.7 V to 5.5 V | 2.7 V to 5.5 V | 2.7 V to 5.5 V |
Key Differentiators
- picoPower sleep architecture (vs ATMEGA164A-MU)
- Extended temperature qualification (vs ATMEGA164P-20MU)
- Lowest memory tier of a pin-compatible ladder (vs ATMEGA644A-MU)
Design Notes
The 44-VQFN exposed pad (EP) under the ATMEGA164P-20MQ is the primary ground connection and must be soldered to a copper pour with a matrix of thermal vias (4-6 vias of 0.3 mm) to the ground plane. An unsoldered or poorly wetted EP is the most common cause of intermittent GND faults and ADC noise on QFN AVRs. Use a solder-paste stencil with approximately 50-60% EP coverage to prevent voiding and device float during reflow.
Decouple VCC and AVCC independently: place 100 nF ceramic capacitors within 3 mm of pins 10 (VCC) and 30 (AVCC), plus 4.7-10 uF bulk capacitance near the supply entry. Filter AVCC through an LC or RC network (10 ohm + 100 nF) so digital switching noise from the 20 MHz core does not degrade ADC accuracy; Microchip AVR datasheets specify AVCC must stay within 0.3 V of VCC at all times. Tie AREF to a clean reference via 100 nF, and never drive AREF while the internal reference is selected.
Fuse-bit misconfiguration is the leading field failure: disabling the SPIEN fuse or selecting an external clock option with no clock present bricks the part, requiring a parallel/high-voltage programmer to recover. When using Timer2 in asynchronous mode on TOSC1/TOSC2 for RTC, keep crystal traces short and guard them with ground, and allow the 32.768 kHz oscillator startup time (per datasheet) before reading time registers. Also confirm JTAG (PC2-PC5) is fuse-disabled if those pins are needed as GPIO.
Estimated: at 5 V, 20 MHz with all I/O active, the ATmega164P draws roughly 10-15 mA, dissipating about 50-75 mW. With the exposed pad properly soldered, junction temperature rise stays well under 5 C above ambient - no heatsinking is needed. Thermal design effort should instead go into any external drivers (MOSFETs, triacs) the MCU controls, not the MCU itself.
Compliance Information
OnlineComponents lists the ATMEGA164P-20MQ as RoHS Compliant; FindIC describes it as GREEN (Microchip green-package designation, halogen-free). REACH and conflict-minerals status not stated in provided data.