Spark Logic

ATmega16U2 pinout

Package pin assignments for ATmega16U2, with peripheral signals, clock grades and a serial programming guide.

TQFP-32

32 contacts Current package
QFN-32 33 contacts

Microchip Technology · 32 numbered contacts. See the individual package drawings for footprint dimensions.

TQFP-32 pinout

TQFP-32
Top view · Pin 1 at the upper left · Schematic outline Scroll the map to reach all contacts.
Selected pin details

11 · PD5

Bidirectional · GPIO

General-purpose digital I/O. Alternate assignments: PCINT12 (EXINT), XCK (USART1), AIN4 (AC).

After reset · GPIO driver is high impedance during reset. Clock, debug, and alternate-function use depend on fuse and peripheral configuration.

7799E · Pinout and peripheral signal descriptions

Electrical limits · Link to this pin

All 32 pins

PinSignalDirectionFunction
1XTAL1 InputInput Oscillator amplifier input or external clock input, depending on clock fuses.
2PC0 BidirectionalBidirectional General-purpose digital I/O. Also serves as oscillator amplifier output XTAL2 when selected by fuses.
3GND ReturnReturn Supply return. Connect every ground pin.
4VCC SupplySupply Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair.
5PC2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: PCINT11 (EXINT), AIN2 (AC).
6PD0 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: OCB (TC0), INT0 (EXINT).
7PD1 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT1 (EXINT), AIN0 (AC).
8PD2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT2 (EXINT), RXD (USART1), AIN1 (AC).
9PD3 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT3 (EXINT), TXD (USART1).
10PD4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT5 (EXINT), AIN3 (AC).
11PD5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: PCINT12 (EXINT), XCK (USART1), AIN4 (AC).
12PD6 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT6 (EXINT), RTS (USART1), AIN5 (AC).
13PD7 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: T (TC0), INT7 (EXINT), CTS (USART1), AIN6 (AC).
14PB0 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SS (SPI), PCINT0 (EXINT).
15PB1 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SCLK (SPI), PCINT1 (EXINT).
16PB2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: MOSI (SPI), PCINT2 (EXINT).
17PB3 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: MISO (SPI), PCINT3 (EXINT).
18PB4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: T (TC1), PCINT4 (EXINT).
19PB5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: PCINT5 (EXINT).
20PB6 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: PCINT6 (EXINT).
21PB7 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: OCA (TC0), OCC (TC1), PCINT7 (EXINT).
22PC7 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ICP (TC1), INT4 (EXINT).
23PC6 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: OCA (TC1), PCINT8 (EXINT).
24PC1 Input / I/OInput / I/O Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured.
25PC5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: OCB (TC1), PCINT9 (EXINT).
26PC4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: PCINT10 (EXINT).
27UCAP Regulator outputRegulator output USB regulator capacitor terminal. Use a 1 µF capacitor to USB ground in the internal regulator configuration.
28UGND ReturnReturn USB transceiver ground. Connect to the board ground return.
29D+ BidirectionalBidirectional Positive USB data line. Route as part of the USB differential pair.
30D- BidirectionalBidirectional Negative USB data line. Route as part of the USB differential pair.
31UVCC SupplySupply USB pad regulator supply. Follow the power scheme for the intended USB mode.
32AVCC SupplySupply Analog supply. Connect it to the supply even if analog conversion is unused. Follow the data sheet’s filtering guidance for precision conversion.

Signal assignments

SPI peripheral

Use SCK, MOSI, MISO and a chip-select line. Firmware selects direction and clock phase. Check the separate ISP mapping when programming. MISO → PB3 · MOSI → PB2 · SCLK → PB1 · SS → PB0

Timer/Counter 0

Review each signal assignment and the peripheral enable conditions in the data sheet. OCA → PB7 · OCB → PD0 · T → PD7

Timer/Counter 1

Review each signal assignment and the peripheral enable conditions in the data sheet. ICP → PC7 · OCA → PC6 · OCB → PC5 · OCC → PB7 · T → PB4

External interrupts

Review each signal assignment and the peripheral enable conditions in the data sheet. INT0 → PD0 · INT1 → PD1 · INT2 → PD2 · INT3 → PD3 · INT4 → PC7 · INT5 → PD4 · INT6 → PD6 · INT7 → PD7 · PCINT0 → PB0 · PCINT1 → PB1 · PCINT2 → PB2 · PCINT3 → PB3 · PCINT4 → PB4 · PCINT5 → PB5 · PCINT6 → PB6 · PCINT7 → PB7 · PCINT8 → PC6 · PCINT9 → PC5 · PCINT10 → PC4 · PCINT11 → PC2 · PCINT12 → PD5

USART1 · Serial

Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. RXD → PD2 · TXD → PD3 · XCK → PD5 · RTS → PD6 · CTS → PD7

Analog comparator

Review each signal assignment and the peripheral enable conditions in the data sheet. AIN0 → PD1 · AIN1 → PD2 · AIN2 → PC2 · AIN3 → PD4 · AIN4 → PD5 · AIN5 → PD6 · AIN6 → PD7

Electrical limits

ParameterLimitConditions and source
Program flash16 KiB16 KiB Nonvolatile program memory. 7799E · Memory
SRAM512 B512 B Volatile data and stack storage. 7799E · Memory
EEPROM512 B512 B Nonvolatile data storage. 7799E · Memory
Clock and supplyOrder-code dependentOrder-code dependent Use the grade table and the device’s speed-versus-voltage curve. 7799E · Electrical Characteristics

Models and documents

Each package lists the documented order codes and variants covered by this map. Select the marked model to see its peripheral assignments and memory. Check the exact order code and datasheet revision before laying out a PCB.

ATmega16U2
16 KiB flash · 512 B SRAM · 512 B EEPROM. Choose the marked order code for voltage, clock, and temperature.
ATmega16U2-AU
16 KiB flash · 512 B SRAM · 512 B EEPROM · 2.7–5.5 V · 16 MHz maximum · -40 to +85 °C