Source: https://mokxi.com/learn/raspberry-pi-pico-pinout

Learn

# Raspberry Pi Pico pinout: every pin, its PWM slice and the power pins

Beginner

Written by the Mokxi team

Start building free Open the editor

Or see every lesson.

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

A dot sweeps back and forth along six LEDs on GP2 to GP7.

The Raspberry Pi Pico has forty pins, twenty-six of them GPIO, and its pinout is simpler than most: every GPIO can do PWM, three of them are analog, and none is a strapping pin that stops the board booting. This page lists all forty with what each can do, the PWM slice and channel behind every GPIO, the power pins and their limits, the onboard LED and which pin to use for what.

The circuit above is a Pico in Mokxi sweeping a dot along six LEDs on GP2 to GP7, one GPIO each. The table is read from the same board model the simulator runs, and where the simulator does less than the RP2040, the page says so.

## Every pin on the header

With the USB socket at the top, physical pin 1 is GP0 at the top left, and the pins count down the left side to 20 and back up the right side from 21 to 40, so VBUS is pin 40 at the top right. The left side is GP0 to GP15 with a ground after every four GPIO. The right side, from the top, is VBUS, VSYS, GND, 3V3_EN, 3V3, ADC_VREF, GP28, AGND, GP27, GP26, RUN, GP22, GND, then GP21 down to GP16 with a ground between GP18 and GP17.

In code a pin is its GP number: digitalWrite(15, HIGH) drives GP15, and A0 to A2 are GP26 to GP28. The PWM column names the slice and channel: "PWM 2A" is slice 2, channel A. The I2C and SPI pins are the defaults; the RP2040 can put each bus on several other pins.

Raspberry Pi Pico: the left side top to bottom, then the right side top to bottom, USB at the top
Pin | GPIO | What it can do | Watch out for

GP0 | 0 | PWM 0A. UART0 TX. | -

GP1 | 1 | PWM 0B. UART0 RX. | -

GND | - | Ground. Seven holes. | -

GP2 | 2 | PWM 1A. | -

GP3 | 3 | PWM 1B. | -

GP4 | 4 | PWM 2A. I2C SDA (default). | -

GP5 | 5 | PWM 2B. I2C SCL (default). | -

GP6 | 6 | PWM 3A. | -

GP7 | 7 | PWM 3B. | -

GP8 | 8 | PWM 4A. | -

GP9 | 9 | PWM 4B. | -

GP10 | 10 | PWM 5A. | -

GP11 | 11 | PWM 5B. | -

GP12 | 12 | PWM 6A. | -

GP13 | 13 | PWM 6B. | -

GP14 | 14 | PWM 7A. | -

GP15 | 15 | PWM 7B. | -

VBUS | - | USB 5 V, straight from the socket. | Not a GPIO.

VSYS | - | The main power input, 1.8 to 5.5 V. | Not a GPIO.

3V3_EN | - | Low turns the 3.3 V regulator off. | Not a GPIO.

3V3 | - | The regulator’s 3.3 V output. | Keep the load under 300 mA.

ADC_VREF | - | The converter’s 3.3 V reference. | Not a GPIO.

GP28 | 28 | PWM 6A. ADC2 (A2). | -

AGND | - | The analog ground for ADC0 to ADC2. | -

GP27 | 27 | PWM 5B. ADC1 (A1). | -

GP26 | 26 | PWM 5A. ADC0 (A0). | -

RUN | - | Low resets the RP2040. | Not a GPIO.

GP22 | 22 | PWM 3A. | -

GP21 | 21 | PWM 2B. | -

GP20 | 20 | PWM 2A. | -

GP19 | 19 | PWM 1B. SPI MOSI (default). | -

GP18 | 18 | PWM 1A. SPI SCK (default). | -

GP17 | 17 | PWM 0B. SPI SS (default). | -

GP16 | 16 | PWM 0A. SPI MISO (default). | -

## Power: VBUS, VSYS, 3V3 and the control pins

VBUS is the 5 V from the USB socket, unchanged. VSYS is the board’s main input: the regulator makes 3.3 V from anything between 1.8 and 5.5 V there, so two or three AA cells on VSYS run the board without USB. With USB plugged in, VSYS sits a diode drop below VBUS. 3V3 is the regulator’s output, and the Pico datasheet asks you to keep its load under 300 mA. 3V3_EN turns the regulator off when pulled low, and RUN resets the chip.

Every GPIO is 3.3 V and none is 5 V tolerant. The RP2040’s pins drive 4 mA by default and can be set to 2, 8 or 12 mA, which is enough for an LED with a resistor and not much more. In Mokxi the board is always on USB, VBUS supplies 5 V and VSYS 4.7 V.

## PWM: which pins share a slice

The RP2040 has eight PWM slices, each with two channels, A and B. GPIO n is on slice (n / 2) mod 8, channel A for an even pin and B for an odd one. So GP0 and GP16 are both slice 0 channel A, and GP0 and GP1 share slice 0.

Two pins on one slice share its frequency. They can have different duty cycles, so two LEDs on GP0 and GP1 fade independently, but a servo at 50 Hz and a motor at 20 kHz cannot share a slice. Put them on pins whose slices differ, say GP2 and GP4. Mokxi models all eight slices the same way, so the on-board LED on GP25 can be faded too.

## Analog inputs, the LED, and the pins that are not on the header

The converter is twelve bits with a 3.3 V reference, on GP26, GP27 and GP28, which are ADC0 to ADC2 and A0 to A2. analogRead returns ten bits unless analogReadResolution asks for more. Use AGND as the ground of an analog sensor and ADC_VREF if you need the reference. Mokxi models the converter one sample at a time, without the FIFO, DMA or noise.

The green LED is on GP25 and lights when the pin is HIGH; LED_BUILTIN is 25. GP25 is not on the header, and neither are GP23, which controls the power supply’s mode, GP24, which senses VBUS, or GP29, which measures VSYS through a divider. That is why the header skips from GP22 to GP26. On a Pico W those four go to the wireless chip and the LED moves with them; the Raspberry Pi Pico W pinout covers the difference.

## Serial, I2C, SPI and BOOTSEL

GP0 and GP1 are UART0’s TX and RX. In the Arduino core for the Pico, Serial is the USB port and Serial1 is UART0 on those two pins. In Mokxi, Serial reaches the serial monitor directly and GP0 and GP1 stay ordinary pins.

Wire.begin() puts I2C on GP4 for SDA and GP5 for SCL, and SPI is GP18, GP16, GP19 and GP17 for SCK, MISO, MOSI and SS. In Mokxi both buses run in software on those pins, because the RP2040’s I2C and SPI blocks are not modeled. BOOTSEL is not a GPIO: held while you plug the board in, it makes the Pico appear as a USB drive for a new program, and nothing you wire can trigger it by accident.

## Questions

Which Pico pin should I use for a button?

Any GP pin, with `INPUT_PULLUP` and the button to ground. The Pico has internal pull-downs too, so `INPUT_PULLDOWN` with the button to 3V3 works as well. There are no strapping pins to avoid.

Which Raspberry Pi Pico pins are analog?

GP26, GP27 and GP28, which are ADC0, ADC1 and ADC2, or `A0` to `A2` in code. Keep the signal between 0 and 3.3 V.

Does the Pico have a 5V pin?

VBUS is 5 V from USB and VSYS is about 5 V less a diode drop. Both can power a 5 V module. No GPIO is 5 V tolerant.

Which pins are I2C and SPI on a Pico?

I2C defaults to GP4 (SDA) and GP5 (SCL). SPI defaults to GP18 (SCK), GP16 (MISO), GP19 (MOSI) and GP17 (SS).

Which Pico pins can do PWM?

All of them. Two pins on the same slice share a frequency, so a servo and a fast motor PWM should go on pins whose slices differ.

Related

## Keep going

Raspberry Pi Pico W Pinout: LED, WiFi Pins, VSYS Raspberry Pi Pico PWM: Slices, Channels and 1 kHz Raspberry Pi Pico Button: Wiring and Code Arduino Uno vs ESP32 vs Pico: Which to Learn First? Run the Raspberry Pi Pico in the simulator Help: the Raspberry Pi Pico model The Raspberry Pi Pico simulator page The project page, with the full sketch Beginner

Sources

## Where the facts on this page come from

- Raspberry Pi: the Pico datasheet (pinout, power, VSYS, 3V3 load)
- Raspberry Pi: the RP2040 datasheet (PWM slices, ADC, pad drive)

## Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.

Start building free Open the editor
