MCU Pinout & Peripheral Multiplexer
See what every pin can do on popular boards, and find pins for I2C, SPI, UART, PWM and analog inputs.
Pin functions
| Pin | Functions | Notes |
|---|
Pin sets for each bus
On the Pico, each signal only needs a pin that offers it, so you can also mix pins from different sets (for example GP10, GP11 and GP12 for SPI1).
| Peripheral | Pins that can be used together |
|---|
How it works
Most pins on a microcontroller can do several jobs. Which job a pin does is chosen by software, a feature called pin multiplexing (or alternate function selection). Choosing a board shows what each pin can do; the filter shows only the pins that support the peripheral you need, and the last table lists the pin sets that work together for each bus.
- I2C needs two pins, SDA (data) and SCL (clock). Several devices share the same two pins.
- SPI uses MOSI, MISO and SCK, plus one chip-select (CS or SS) pin for each device.
- UART (serial) uses TX and RX, and sometimes CTS and RTS for flow control.
- PWM gives a variable duty-cycle signal for dimming, motors and servos. Pins that share a timer share a frequency.
- ADC reads an analog voltage. Resolution and the number of channels depend on the chip.
On the RP2040 the table is built from the chip’s fixed function-select pattern: for pin GPn, the SPI role follows n mod 4 (RX, CSn, SCK, TX), the SPI block is chosen by n ÷ 8, the I2C role and block follow n mod 4, and the PWM slice is n ÷ 2 (rounded down), with channel A on even pins and B on odd pins.
Worked example
You want an I2C sensor, an SPI display and a serial link on an ESP32 with the pins left at their defaults. I2C takes GPIO21 and GPIO22; the display on VSPI takes GPIO5 (CS), GPIO18, GPIO19 and GPIO23; the serial link on UART2 takes GPIO16 and GPIO17. No pin is used twice. If you moved to HSPI instead, GPIO12 and GPIO15 are strapping pins and may stop the board booting if the display holds them at the wrong level during reset. On a Raspberry Pi Pico, the same setup could use I2C0 on GP4 and GP5, SPI1 on GP10 to GP13 (GP10 is SCK, GP11 is TX, GP12 is RX, and any GPIO can act as CS), and UART0 on GP0 and GP1. You can check each choice by filtering for the peripheral.
Things to know
Check the datasheet for your exact board. Board makers sometimes wire pins to on-board parts (LEDs, USB, flash, a radio), so a pin that exists on the chip may not be free on your board.
Logic level matters. The ESP32 and RP2040 are 3.3 V devices. Connecting a 5 V signal to them can damage the chip. Use a level shifter or a voltage divider.
Strapping pins set the chip’s boot mode while it resets. Anything attached to them (a pull-up resistor, a sensor output, a display) can stop the board from starting. Keep them for simple, lightly loaded jobs.
Shared timers. On the Uno, PWM pins on the same timer share a frequency, and Timer0 also keeps time for millis() and delay(). On the RP2040, both channels of a slice share a frequency.
Wi-Fi and the ADC. On the ESP32, ADC2 pins cannot be read while Wi-Fi is active. Use ADC1 pins (GPIO32 to GPIO39) for analog inputs in a Wi-Fi project.
The Arduino core may move things. Default pins differ between software environments (Arduino, MicroPython, the Pico SDK). The table shows what the hardware allows, not any one library’s default.
Other boards. This tool covers three popular boards for now. The ideas carry over to any microcontroller; the pin table will differ.
Common questions
What is a pin multiplexer?
A switching block inside the chip that connects one physical pin to one of several internal peripherals, such as a UART, SPI or I2C block, or to plain GPIO. Software picks the connection by writing to a register.
Can I use any two pins for I2C?
It depends on the chip. On an ESP32 almost any two pins work. On the Uno only A4 and A5 do, and on the RP2040 each I2C block has a fixed set of pin pairs.
Why does my ESP32 not boot with something connected?
You may have a device on a strapping pin (GPIO0, GPIO2, GPIO5, GPIO12 or GPIO15) that pulls it to the wrong level during reset. Move it to another pin or disconnect it while uploading.
Why are some pins marked “input only”?
On the ESP32, GPIO34 to GPIO39 can only read signals. They have no output driver or internal pull resistors, so they suit analog sensors but not LEDs or buttons without an external pull-up.
Sources
- Raspberry Pi, RP2040 Datasheet, GPIO function table.
- Espressif, ESP32 Series Datasheet and Technical Reference Manual (IO MUX, strapping pins).
- Microchip, ATmega328P Datasheet; Arduino Uno Rev3 documentation.
Last reviewed: October 22, 2026
