Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 20 MIPS Throughput at 20 MHz On-chip 2-cycle Multiplier High Endurance Non-volatile Memory Segments 4/8/16/32K Bytes of In-System Self-Programmable Flash progam memory (ATmega48PA/88PA/168PA/328P) 8-bit 256/512/512/1K Bytes EEPROM (ATmega48PA/88PA/168PA/328P) 512/1K/1K/2K Bytes Internal SRAM (ATmega48PA/88PA/168PA/328P) Microcontroller Write/Erase Cycles: 10,000 Flash/100,000 EEPROM (1) Data retention: 20 years at 85C/100 years at 25C with 4/8/16/32K Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program Bytes In-System True Read-While-Write Operation Programming Lock for Software Security Peripheral Features Programmable Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Flash Mode Real Time Counter with Separate Oscillator Six PWM Channels 8-channel 10-bit ADC in TQFP and QFN/MLF package ATmega48PA Temperature Measurement 6-channel 10-bit ADC in PDIP Package ATmega88PA Temperature Measurement Programmable Serial USART ATmega168PA Master/Slave SPI Serial Interface 2 Byte-oriented 2-wire Serial Interface (Philips I C compatible) ATmega328P Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Interrupt and Wake-up on Pin Change Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and Extended Standby I/O and Packages 23 Programmable I/O Lines 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF Operating Voltage: 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P Temperature Range: -40C to 85C Speed Grade: 0 - 20 MHz 1.8 - 5.5V Low Power Consumption at 1 MHz, 1.8V, 25C for ATmega48PA/88PA/168PA/328P: Active Mode: 0.2 mA Power-down Mode: 0.1 A Power-save Mode: 0.75 A (Including 32 kHz RTC) Rev. 8161DAVR10/09ATmega48PA/88PA/168PA/328P 1. Pin Configurations Figure 1-1. Pinout ATmega48PA/88PA/168PA/328P TQFP Top View PDIP (PCINT14/RESET) PC6 1 28 PC5 (ADC5/SCL/PCINT13) (PCINT16/RXD) PD0 2 27 PC4 (ADC4/SDA/PCINT12) (PCINT17/TXD) PD1 3 26 PC3 (ADC3/PCINT11) (PCINT19/OC2B/INT1) PD3 1 24 PC1 (ADC1/PCINT9) (PCINT18/INT0) PD2 4 25 PC2 (ADC2/PCINT10) (PCINT20/XCK/T0) PD4 2 23 PC0 (ADC0/PCINT8) (PCINT19/OC2B/INT1) PD3 5 24 PC1 (ADC1/PCINT9) 22 ADC7 GND 3 (PCINT20/XCK/T0) PD4 6 23 PC0 (ADC0/PCINT8) VCC 4 21 GND VCC 7 22 GND GND 5 20 AREF GND 8 21 AREF VCC 6 19 ADC6 (PCINT6/XTAL1/TOSC1) PB6 9 20 AVCC 18 AVCC (PCINT6/XTAL1/TOSC1) PB6 7 (PCINT7/XTAL2/TOSC2) PB7 10 19 PB5 (SCK/PCINT5) (PCINT7/XTAL2/TOSC2) PB7 8 17 PB5 (SCK/PCINT5) (PCINT21/OC0B/T1) PD5 11 18 PB4 (MISO/PCINT4) (PCINT22/OC0A/AIN0) PD6 12 17 PB3 (MOSI/OC2A/PCINT3) (PCINT23/AIN1) PD7 13 16 PB2 (SS/OC1B/PCINT2) (PCINT0/CLKO/ICP1) PB0 14 15 PB1 (OC1A/PCINT1) 32 MLF Top View 28 MLF Top View (PCINT19/OC2B/INT1) PD3 1 24 PC1 (ADC1/PCINT9) (PCINT19/OC2B/INT1) PD3 1 21 PC2 (ADC2/PCINT10) (PCINT20/XCK/T0) PD4 PC0 (ADC0/PCINT8) 2 23 (PCINT20/XCK/T0) PD4 2 20 PC1 (ADC1/PCINT9) ADC7 GND 3 22 VCC 19 PC0 (ADC0/PCINT8) 3 VCC 4 21 GND GND 4 18 GND GND 5 20 AREF (PCINT6/XTAL1/TOSC1) PB6 5 17 AREF VCC ADC6 6 19 (PCINT7/XTAL2/TOSC2) PB7 6 16 AVCC (PCINT6/XTAL1/TOSC1) PB6 7 18 AVCC (PCINT21/OC0B/T1) PD5 15 PB5 (SCK/PCINT5) 7 (PCINT7/XTAL2/TOSC2) PB7 8 17 PB5 (SCK/PCINT5) NOTE: Bottom pad should be soldered to ground. NOTE: Bottom pad should be soldered to ground. 2 8161DAVR10/09 (PCINT21/OC0B/T1) PD5 9 32 PD2 (INT0/PCINT18) (PCINT22/OC0A/AIN0) PD6 8 28 PD2 (INT0/PCINT18) (PCINT22/OC0A/AIN0) PD6 10 31 PD1 (TXD/PCINT17) 9 27 (PCINT23/AIN1) PD7 PD1 (TXD/PCINT17) (PCINT23/AIN1) PD7 11 30 PD0 (RXD/PCINT16) (PCINT0/CLKO/ICP1) PB0 10 26 PD0 (RXD/PCINT16) (PCINT0/CLKO/ICP1) PB0 12 29 PC6 (RESET/PCINT14) (PCINT1/OC1A) PB1 11 25 PC6 (RESET/PCINT14) (PCINT1/OC1A) PB1 13 28 PC5 (ADC5/SCL/PCINT13) 12 24 PC5 (ADC5/SCL/PCINT13) (PCINT2/SS/OC1B) PB2 (PCINT2/SS/OC1B) PB2 14 27 PC4 (ADC4/SDA/PCINT12) 13 23 (PCINT3/OC2A/MOSI) PB3 PC4 (ADC4/SDA/PCINT12) (PCINT3/OC2A/MOSI) PB3 15 26 PC3 (ADC3/PCINT11) (PCINT4/MISO) PB4 14 22 PC3 (ADC3/PCINT11) (PCINT4/MISO) PB4 16 25 PC2 (ADC2/PCINT10) 9 32 (PCINT21/OC0B/T1) PD5 PD2 (INT0/PCINT18) (PCINT22/OC0A/AIN0) PD6 10 31 PD1 (TXD/PCINT17) (PCINT23/AIN1) PD7 11 30 PD0 (RXD/PCINT16) (PCINT0/CLKO/ICP1) PB0 12 29 PC6 (RESET/PCINT14) 13 28 (PCINT1/OC1A) PB1 PC5 (ADC5/SCL/PCINT13) (PCINT2/SS/OC1B) PB2 14 27 PC4 (ADC4/SDA/PCINT12) (PCINT3/OC2A/MOSI) PB3 15 26 PC3 (ADC3/PCINT11) 16 25 (PCINT4/MISO) PB4 PC2 (ADC2/PCINT10)