8161DS–AVR–10/09 ATmega48PA/88PA/168PA/328P ATmega48PA/88PA/168PA/328P Pin Configurations Figure 1-1. Pinout ATmega48PA/88PA/168PA/328P TQFP Top View PDIP (PCINT2/SS/OC1B) PB2 PC4 (ADC4/SDA/PCINT12) (PCINT1/OC1A) PB1 PC5 (ADC5/SCL/PCINT13) (PCINT0/CLKO/ICP1) PB0 PC6 (RESET/PCINT14) (PCINT3/OC2A/MOSI) PB3 PC3 (ADC3/PCINT11) (PCINT4/MISO) PB4 PC2 (ADC2/PCINT10) (PCINT21/OC0B/T1) PD5 PD2 (INT0/PCINT18) (PCINT23/AIN1) PD7 PD0 (RXD/PCINT16) (PCINT22/OC0A/AIN0) PD6 PD1 (TXD/PCINT17) (PCINT0/CLKO/ICP1) PB0 PB1 (OC1A/PCINT1) 32 MLF Top View (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 GND VCC GND VCC (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) ADC7 GND AREF ADC6 AVCC PB5 (SCK/PCINT5) (PCINT14/RESET) PC6 (PCINT16/RXD) PD0 (PCINT17/TXD) PD1 (PCINT18/INT0) PD2 (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 VCC GND (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 (PCINT21/OC0B/T1) PD5 (PCINT22/OC0A/AIN0) PD6 (PCINT23/AIN1) PD7 PC5 (ADC5/SCL/PCINT13) PC4 (ADC4/SDA/PCINT12) PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) GND AREF AVCC PB5 (SCK/PCINT5) PB4 (MISO/PCINT4) PB3 (MOSI/OC2A/PCINT3) PB2 (SS/OC1B/PCINT2) 28 MLF Top View (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 GND VCC GND VCC (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 PC1 (ADC1/PCINT9) AVCC PB5 (SCK/PCINT5) (PCINT21/OC0B/T1) PD5(PCINT22/OC0A/AIN0) PD6(PCINT23/AIN1) PD7(PCINT0/CLKO/ICP1) PB0(PCINT1/OC1A) PB1(PCINT2/SS/OC1B) PB2(PCINT3/OC2A/MOSI) PB3(PCINT4/MISO) PB4 PD2 (INT0/PCINT18)PD1 (TXD/PCINT17)PC6 (RESET/PCINT14)PC4 (ADC4/SDA/PCINT12)PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) PB5 (SCK/PCINT5) PC5 (ADC5/SCL/PCINT13) PD2 (INT0/PCINT18) PD1 (TXD/PCINT17) PD0 (RXD/PCINT16) PC6 (RESET/PCINT14) PC5 (ADC5/SCL/PCINT13) PC4 (ADC4/SDA/PCINT12) PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) PD0 (RXD/PCINT16) (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 VCC GND (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 (PCINT21/OC0B/T1) PD5 (PCINT22/OC0A/AIN0) PD6(PCINT23/AIN1) PD7(PCINT0/CLKO/ICP1) PB0(PCINT1/OC1A) PB1(PCINT2/SS/OC1B) PB2(PCINT3/OC2A/MOSI) PB3(PCINT4/MISO) PB4 PC0 (ADC0/PCINT8) PC1 (ADC1/PCINT9) ADC7 PC0 (ADC0/PCINT8) GND GND AREF AREF ADC6 AVCC NOTE: Bottom pad should be soldered to ground. NOTE: Bottom pad should be soldered to ground. 8161DS–AVR–10/09 ATmega48PA/88PA/168PA/328P 1.1 Pin Descriptions 1.1.1 VCC Digital supply voltage. 1.1.2 GND Ground. 1.1.3 Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Depending on the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier. If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set. The various special features of Port B are elaborated in ”Alternate Functions of Port B” on page 76 and ”System Clock and Clock Options” on page 26. 1.1.4 Port C (PC5:0) Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The PC5..0 output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. 1.1.5 PC6/RESET If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even if the clock is not running. The minimum pulse length is given in Table 28-3 on page 308. Shorter pulses are not guaranteed to generate a Reset. The various special features of Port C are elaborated in ”Alternate Functions of Port C” on page 79. 1.1.6 Port D (PD7:0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. 8161DS–AVR–10/09 ATmega48PA/88PA/168PA/328P ATmega48P...