ATMEGA164P-20PU - 8-bit AVR MCU 16KB Flash 20MHz DIP-40 | Microchip
MPN: ATMEGA164P-20PU β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.23 | $2.23 |
| 10 | $2.05 | $20.50 |
| 100 | $1.86 | $186.00 |
| 500 | $1.7 | $850.00 |
| 1,000 | $1.55 | $1,550.00 |
ATMEGA164P-20PU Overview
An 8-bit AVR microcontroller is a Harvard-architecture RISC processor that executes most instructions in a single clock cycle. Within the power-management IC hierarchy, it sits at the embedded-control level: microcontroller -> embedded processor -> system-on-chip. The ATmega family is widely used for standalone embedded control, hobby and educational systems, and industrial sensing nodes.
Key features include 16 KB of self-programmable ISP FLASH with read-while-write capability, 512 B EEPROM, 1 KB internal SRAM, and 32 general-purpose I/O lines. The picoPower technology delivers low active and sleep current consumption, making the device suitable for battery-powered designs. Peripherals include two USARTs, a byte-oriented Two-Wire Interface (TWI/I2C), an SPI interface, an 8-channel 10-bit ADC, three flexible timers/counters with compare modes and PWM, a real-time counter, and on-chip JTAG debug/programming.
The Advanced RISC Architecture provides 131 powerful instructions, most executing in a single clock cycle, with 32 general-purpose working registers fully connected to the ALU. Executing one instruction per clock at 20 MHz yields up to 20 MIPS throughput. In-system programmability via SPI, plus JTAG boundary-scan per IEEE 1149.1 methodology support, simplifies manufacturing and field updates.
Typical applications include industrial control panels, sensor and data-logging nodes, motor and LED control, and educational/embedded platforms where through-hole DIP mounting allows easy prototyping and socketed replacement.
A key design consideration: the P (picoPower) variant has a newer die revision, the ATMEGA164PA, which is drop-in compatible and recommended for new designs; also note the device supports VCC down to 2.7 V, but full 20 MHz operation requires approximately 4.5 V to 5.5 V per AVR speed-grade curves.
This page adds distributor pricing, drop-in alternatives, complete DIP-40 pinout, and design notes not consolidated in the manufacturer datasheet.
Drop-in alternatives for ATMEGA164P-20PU β 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-20PU (same form factor and footprint) β differing in Package, ADC, Flash Program Memory, Instructions, Operating Temperature.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
ATMEGA164PA-PU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA324P-20PU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA644P-20PU
β Drop-Inπ Reference alternative (not in catalog)
ATMEGA16-16PI
β Drop-Inβ In Stock
$3.72 / Unit
View Datasheet βATMEGA16-16PC
β Drop-Inβ In Stock
$4.48 / Unit
View Datasheet βATMEGA164P-20PI
β Drop-In β οΈ εζ°εΎ ιͺθ―π Reference alternative (not in catalog)
ATMEGA164P-20PU Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit AVR RISC |
| Flash Memory | 16 KB (8K x 16) ISP FLASH |
| EEPROM | 512 B |
| SRAM | 1 KB |
| Maximum Clock Frequency | 20 MHz |
| Peak Throughput | Up to 20 MIPS at 20 MHz |
| Supply Voltage Range | 2.7 V to 5.5 V |
| General Purpose I/O Lines | 32 |
| ADC | 8-channel, 10-bit |
| USART | 2 |
| Serial Interfaces | TWI (I2C), SPI |
| Timers/Counters | 3 with compare modes and PWM |
| Debug / Programming | JTAG (on-chip debug), ISP |
| Package | 40-PDIP (DIP-40) through-hole |
| Technology | picoPower low-power |
| Mounting Type | Through Hole |
| Lifecycle Status | Active (newer ATMEGA164PA available) |
ATMEGA164P-20PU Pin Configuration
| Pin 1 | PB0 (XCK0/T0) β Port B bit 0; USART0 external clock / Timer0 external clock |
| Pin 2 | PB1 (T1) β Port B bit 1; Timer1 external clock input |
| Pin 3 | PB2 (INT2/AIN0) β Port B bit 2; external interrupt 2 / analog comparator positive input |
| Pin 4 | PB3 (AIN1) β Port B bit 3; analog comparator negative input |
| Pin 5 | PB4 (SS) β Port B bit 4; SPI slave select |
| Pin 6 | PB5 (MOSI) β Port B bit 5; SPI master output / slave input |
| Pin 7 | PB6 (MISO) β Port B bit 6; SPI master input / slave output |
| Pin 8 | PB7 (SCK) β Port B bit 7; SPI serial clock |
| Pin 9 | RESET β Active-low reset input / ISP reset |
| Pin 10 | VCC β Digital supply voltage (2.7 V to 5.5 V) |
| Pin 11 | GND β Ground |
| Pin 12 | XTAL2 β Crystal oscillator output |
| Pin 13 | XTAL1 β Crystal oscillator input / external clock input |
| Pin 14 | PD0 (RXD0) β Port D bit 0; USART0 receive data |
| Pin 15 | PD1 (TXD0) β Port D bit 1; USART0 transmit data |
| Pin 16 | PD2 (RXD1/INT0) β Port D bit 2; USART1 receive / external interrupt 0 |
| Pin 17 | PD3 (TXD1/INT1) β Port D bit 3; USART1 transmit / external interrupt 1 |
| Pin 18 | PD4 (XCK1/T0) β Port D bit 4; USART1 external clock / Timer0 external clock |
| Pin 19 | PD5 (OC1A) β Port D bit 5; Timer/Counter1 output compare A (PWM) |
| Pin 20 | PD6 (ICP1) β Port D bit 6; Timer/Counter1 input capture |
| Pin 21 | PD7 (OC2A) β Port D bit 7; Timer/Counter2 output compare A (PWM) |
| Pin 22 | PC0 (SCL) β Port C bit 0; TWI serial clock |
| Pin 23 | PC1 (SDA) β Port C bit 1; TWI serial data |
| Pin 24 | PC2 (TCK) β Port C bit 2; JTAG test clock |
| Pin 25 | PC3 (TMS) β Port C bit 3; JTAG test mode select |
| Pin 26 | PC4 (TDO) β Port C bit 4; JTAG test data output |
| Pin 27 | PC5 (TDI) β Port C bit 5; JTAG test data input |
| Pin 28 | PC6 (TOSC1) β Port C bit 6; Timer oscillator input (32.768 kHz crystal) |
| Pin 29 | PC7 (TOSC2) β Port C bit 7; Timer oscillator output |
| Pin 30 | AVCC β Analog supply voltage for ADC and Port A |
| Pin 31 | GND β Ground |
| Pin 32 | AREF β Analog reference voltage for ADC |
| Pin 33 | PA0 (ADC0) β Port A bit 0; ADC channel 0 |
| Pin 34 | PA1 (ADC1) β Port A bit 1; ADC channel 1 |
| Pin 35 | PA2 (ADC2) β Port A bit 2; ADC channel 2 |
| Pin 36 | PA3 (ADC3) β Port A bit 3; ADC channel 3 |
| Pin 37 | PA4 (ADC4) β Port A bit 4; ADC channel 4 |
| Pin 38 | PA5 (ADC5) β Port A bit 5; ADC channel 5 |
| Pin 39 | PA6 (ADC6) β Port A bit 6; ADC channel 6 |
| Pin 40 | PA7 (ADC7) β Port A bit 7; ADC channel 7 |
Typical Applications
ATMEGA164P-20PU is suitable for 6 applications: Industrial Control Panels, Sensor and Data-Logging Nodes, Motor and LED Control, Multi-Channel Serial Communication Gateways, Educational and Hobbyist Embedded Platforms, Battery-Powered Instrumentation.
Industrial Control Panels
The ATMEGA164P-20PU fits industrial control panels where a through-hole, socket-mounted MCU simplifies maintenance and field replacement. Its 20 MHz AVR core delivers up to 20 MIPS for real-time scanning of discrete inputs, relay outputs, and simple PID loops, while the two independent USARTs allow simultaneous Modbus RTU (RS-485) and operator-console (RS-232) links. The 10-bit ADC with 8 channels reads potentiometer setpoints and analog transducers, and the 512 B EEPROM retains calibration constants across power cycles. The 5.5 V maximum rating supports direct connection to industrially common 5 V logic rails, and the DIP-40 package tolerates the rework environments typical of panel assembly.
Recommended
Sensor and Data-Logging Nodes
picoPower technology makes the ATMEGA164P-20PU well suited to battery-backed sensor nodes and data loggers. The device supports multiple sleep modes, including power-save with a real-time counter running from a separate 32.768 kHz crystal on TOSC1/TOSC2 (PC6/PC7), enabling periodic wake-and-measure duty cycles. In each wake event, the 8-channel 10-bit ADC digitizes sensor inputs and results are stored in the 1 KB SRAM buffer or streamed over USART. The 512 B EEPROM safely holds configuration even during battery swaps. Designs should budget clock-frequency derating if running below 4.5 V from a 3-cell or discharging Li-ion supply.
Recommended
Motor and LED Control
Three timers/counters with compare modes and PWM outputs let the ATMEGA164P-20PU drive motors, fans, and LED strings directly. The 16-bit Timer/Counter1 generates high-resolution PWM on OC1A/OC1B (PD5/PD4 area pins), while 8-bit timers handle auxiliary PWM channels and system ticks. At 20 MHz, PWM resolution reaches full 10-bit at roughly 19.5 kHz, above audible range for fan and LED dimming applications. The analog comparator supports zero-cross and current-limit detection. Combined with the 10-bit ADC for back-EMF or current feedback, this makes the MCU a compact closed-loop controller for small DC motors and brightness-controlled LED fixtures.
Recommended
Multi-Channel Serial Communication Gateways
With two full USARTs plus TWI and SPI, the ATMEGA164P-20PU acts as a compact protocol gateway: USART0 on PD0/PD1 can bridge RS-232 field devices while USART1 on PD2/PD3 handles an RS-485 network, and the SPI or TWI interface connects to displays, memories, or sensors on the controller side. Hardware support for multi-processor communication modes and the 20 MIPS core headroom allow concurrent buffering of two traffic streams within the 1 KB SRAM. This peripheral density in a through-hole DIP-40 makes it popular for retrofit gateways in legacy equipment where SMD assembly is impractical.
Recommended
Educational and Hobbyist Embedded Platforms
The DIP-40 package, socketed mounting, free AVR GCC toolchain, and ubiquitous ISP programmers (USBasp, AVR ISP mkII) make the ATMEGA164P-20PU a staple of embedded-systems education and hobby projects. Students can breadboard the minimum system with a 16 MHz crystal, program in-system through the SPI header (PB5/PB6/PB7 plus RESET), and debug via the on-chip JTAG port on PC2-PC5 using low-cost JTAG ICE clones. The 32 GPIO lines and rich peripheral set support progressively complex labs, from LED blinking to dual-UART networking, on a single chip costing roughly $2.23 as of 2026-09-16.
Recommended
Battery-Powered Instrumentation
Portable measurement instruments benefit from the ATMEGA164P-20PU's balance of processing power and sleep current. Between measurements the MCU rests in power-down mode with only the asynchronous timer or external interrupt armed, then wakes on a button press or RTC alarm to run a 10-bit ADC conversion sequence. The 2.7 V low end of the supply range allows operation from two alkaline cells through a boost converter or three cells directly at reduced clock frequency. The JTAG interface permits full in-system debug during instrument development without disturbing the analog front end, and the through-hole package eases one-off repairs of field instruments.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA164P-20PU β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA164PA-PU | ATMEGA324P-20PU | ATMEGA644P-20PU | ATMEGA16-16PI |
|---|---|---|---|---|---|
| Package | DIP-40 (40-PDIP) | DIP-40 - same | DIP-40 - same | DIP-40 - same | DIP-40 - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 16 KB | 16 KB | 32 KB | 64 KB | 16 KB |
| SRAM | 1 KB | 1 KB | 2 KB | 4 KB | 1 KB |
| Max Clock Frequency | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 16 MHz |
| USART Count | 2 | 2 | 2 | 2 | 1 |
| Technology | picoPower | picoPower (newer die) | picoPower | picoPower | Legacy (non-picoPower) |
| EEPROM | 512 B | 512 B | 1 KB | 2 KB | 512 B |
| Lifecycle Status | Active (newer ATMEGA164PA available) | Active (recommended for new designs) | Active | Active | Active / legacy |
Key Differentiators
- Two independent USARTs in a DIP-40 footprint (vs ATMEGA16-16PI)
- picoPower low-power die (vs ATMEGA16-16PI)
- Lowest-cost family entry point (vs ATMEGA324P-20PU)
Design Notes
Respect the AVR speed-versus-voltage safe operating area: the 20 MHz speed grade is guaranteed only near the top of the 2.7 V to 5.5 V range (approximately 4.5 V and above per family datasheet curves). Running at 20 MHz on a 3.3 V rail is out of specification and may cause intermittent failures. Derate clock frequency linearly for lower VCC, or regulate to 5 V for full-speed designs. Estimated: at 5 V and 20 mA average I/O plus core load, power dissipation is roughly 100 mW - negligible thermally in DIP-40.
Place 100 nF ceramic decoupling capacitors directly across VCC/GND (pins 10/11) and AVCC/GND (pins 30/31), keeping AVCC within 0.3 V of VCC at all times - even if the ADC is unused, AVCC must be tied to VCC through a low-pass filter (10 nH ferrite plus 100 nF) for guaranteed port-A operation. Tie AREF to AVCC via a 100 nF capacitor when using the internal reference, and never drive AREF externally while the internal reference is enabled, as this can short the reference amplifier.
Enable JTAG fuse disabling if PC2-PC5 are needed as GPIO - JTAG is enabled by default and holds those four port-C pins in JTAG mode. Also configure the clock-source fuses carefully: selecting an external crystal fuse setting with no crystal fitted can brick the device into an unprogrammable state; recovery requires a controlled-clock ISP rescue. When migrating from ATmega16/32, use Microchip application note AVR505 since register names and fuse maps differ between families despite pin compatibility.
For ISP and JTAG lines keep PB5-PB7 and PC2-PC5 traces short and away from motor/PWM switch nodes; the SPI clock edge rates on a 20 MHz AVR are fast enough to pick up coupling on long breadboard wires. Series 22-100 ohm resistors on XTAL1 and long RESET lines improve noise immunity. For the 32.768 kHz RTC crystal on PC6/PC7, follow the datasheet load-capacitor recommendation and physically isolate the crystal from high-swing digital lines to avoid startup failures.
Compliance Information
Compliance status was not stated in the verified web data; modern Microchip ATmega devices are typically RoHS-compliant, but confirm on the Microchip product page before export documentation.