Spark Logic

ATmega16U2 pinout

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

PackageContactsDetails
TQFP-32 32 32 numbered contacts. See the individual package drawings for footprint dimensions.
QFN-32 33 32 numbered contacts. The underside pad appears below the contact map. See the individual package drawings for footprint dimensions.

Microchip Technology

Device variants · QFN-32

DeviceFlashSRAMEEPROMSupplyMax clockTemperature
ATmega16U2 16 KiB 512 B 512 B — — —
ATmega16U2-MU 16 KiB 512 B 512 B 2.7–5.5 V 16 MHz -40 to +85 °C

QFN-32 pinout

QFN-32 · Marking side · Pin 1 at the upper left
Dashed outline shows the underside pad schematically. See the package drawing for the footprint.
Selected pin details

1 · XTAL1

Input · Clock inputs / oscillator

Oscillator amplifier input or external clock input, depending on clock fuses.

7799E · Pinout and peripheral signal descriptions

Electrical limits · Link to this pin

Power and reset

  • Target rail
    • Bench supply positive
  • Ground
    • Bench supply return
  • Reset
  • Filtered AVCC
  • USB regulator output
100 nF per supply pair between Target rail and GroundTarget rail100 nF per supply pairGround
10 kΩ between Target rail and ResetTarget rail10 kΩReset
Ferrite bead between Target rail and Filtered AVCCTarget railFerrite beadFiltered AVCC
100 nF between Filtered AVCC and GroundFiltered AVCC100 nFGround
1 µF ±10% between USB regulator output and GroundUSB regulator output1 µF ±10%Ground

Connection guide

All 33 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: HWB (BOOT_LOAD), 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 Supply for the analog comparator and PLL. Feed AVCC from VCC through a low-pass filter.
EPEP Exposed padExposed pad For QFN-32, the manufacturer recommends soldering the center pad to board ground for mechanical stability. Connect GND and UGND as well.

Signal assignments

Boot selection

Review each signal assignment and the peripheral enable conditions in the data sheet. HWB → PD7

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

USB device

Route D+ and D− through individual series resistors. Use UVCC for USB regulator input, UCAP for its capacitor and UGND for USB ground. VBUS is on the USB connector.

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

Manufacturer 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.