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
Package pin assignments for ATmega16U2, with peripheral signals, clock grades and a serial programming guide.
General-purpose digital I/O. Alternate assignments: INT5 (EXINT), AIN3 (AC).
After reset · GPIO driver is high impedance during reset. Clock, debug, and alternate-function use depend on fuse and peripheral configuration.
| Pin | Signal | Direction | Function |
|---|---|---|---|
| 1 | XTAL1 Input | Input | Oscillator amplifier input or external clock input, depending on clock fuses. |
| 2 | PC0 Bidirectional | Bidirectional | General-purpose digital I/O. Also serves as oscillator amplifier output XTAL2 when selected by fuses. |
| 3 | GND Return | Return | Supply return. Connect every ground pin. |
| 4 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| 5 | PC2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT11 (EXINT), AIN2 (AC). |
| 6 | PD0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC0), INT0 (EXINT). |
| 7 | PD1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: INT1 (EXINT), AIN0 (AC). |
| 8 | PD2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: INT2 (EXINT), RXD (USART1), AIN1 (AC). |
| 9 | PD3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: INT3 (EXINT), TXD (USART1). |
| 10 | PD4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: INT5 (EXINT), AIN3 (AC). |
| 11 | PD5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT12 (EXINT), XCK (USART1), AIN4 (AC). |
| 12 | PD6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: INT6 (EXINT), RTS (USART1), AIN5 (AC). |
| 13 | PD7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC0), INT7 (EXINT), CTS (USART1), AIN6 (AC). |
| 14 | PB0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SS (SPI), PCINT0 (EXINT). |
| 15 | PB1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SCLK (SPI), PCINT1 (EXINT). |
| 16 | PB2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: MOSI (SPI), PCINT2 (EXINT). |
| 17 | PB3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: MISO (SPI), PCINT3 (EXINT). |
| 18 | PB4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC1), PCINT4 (EXINT). |
| 19 | PB5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT5 (EXINT). |
| 20 | PB6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT6 (EXINT). |
| 21 | PB7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC0), OCC (TC1), PCINT7 (EXINT). |
| 22 | PC7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC1), INT4 (EXINT). |
| 23 | PC6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC1), PCINT8 (EXINT). |
| 24 | PC1 Input / I/O | Input / I/O | Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured. |
| 25 | PC5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC1), PCINT9 (EXINT). |
| 26 | PC4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT10 (EXINT). |
| 27 | UCAP Regulator output | Regulator output | USB regulator capacitor terminal. Use a 1 µF capacitor to USB ground in the internal regulator configuration. |
| 28 | UGND Return | Return | USB transceiver ground. Connect to the board ground return. |
| 29 | D+ Bidirectional | Bidirectional | Positive USB data line. Route as part of the USB differential pair. |
| 30 | D- Bidirectional | Bidirectional | Negative USB data line. Route as part of the USB differential pair. |
| 31 | UVCC Supply | Supply | USB pad regulator supply. Follow the power scheme for the intended USB mode. |
| 32 | AVCC Supply | Supply | Analog supply. Connect it to the supply even if analog conversion is unused. Follow the data sheet’s filtering guidance for precision conversion. |
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
Review each signal assignment and the peripheral enable conditions in the data sheet. OCA → PB7 · OCB → PD0 · T → PD7
Review each signal assignment and the peripheral enable conditions in the data sheet. ICP → PC7 · OCA → PC6 · OCB → PC5 · OCC → PB7 · T → PB4
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
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
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
Use the differential data pair and the USB pad supply and regulator network. See the manufacturer circuit for the chosen supply mode.
| Parameter | Limit | Conditions and source |
|---|---|---|
| Program flash16 KiB | 16 KiB | Nonvolatile program memory. 7799E · Memory |
| SRAM512 B | 512 B | Volatile data and stack storage. 7799E · Memory |
| EEPROM512 B | 512 B | Nonvolatile data storage. 7799E · Memory |
| Clock and supplyOrder-code dependent | Order-code dependent | Use the grade table and the device’s speed-versus-voltage curve. 7799E · Electrical Characteristics |
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.