XIAO RP2040 Pinout, Datasheet, Schematic [Ultimate Guide]

In this guide, you’ll find the XIAO RP2040 pinout diagram, its datasheet and schematic diagram, and every pin group explained with its default pins and gotchas. It’s the complete Seeed XIAO RP2040 pinout reference (sold as the Seeed Studio XIAO RP2040, and still called the Seeeduino XIAO RP2040 by many shops) that you need before wiring your first project. Without further ado, let’s get right into it!

The XIAO RP2040 is Seeed Studio’s thumb-sized board built on the Raspberry Pi RP2040, the same chip as the Raspberry Pi Pico: a dual-core Arm Cortex-M0+ at up to 133MHz with 264KB SRAM and 2MB of flash. On a 21 × 17.8mm board, it gives you 11 GPIO pins (all 3.3v), 4 analog inputs, a USB-C port, a 3-colour user LED, and a NeoPixel RGB LED.


XIAO RP2040 Pinout Diagram

Here is a detailed XIAO RP2040 Pinout Diagram with colored labels and legends to help you easily identify the functionalities that each pin can perform. It shows all 14 edge pins with their XIAO names (D0–D10), the RP2040 GPIO numbers, and each pin’s ADC, PWM, UART, SPI and I2C functions, plus the SWD, RUN and VIN pads on the back.

XIAO RP2040 pinout diagram with GPIO, ADC, PWM, UART, SPI, I2C and back-pad SWD pin functions (Seeed Studio XIAO RP2040)
Seeed Studio XIAO RP2040: 14 edge pins, back-side pads, and on-board parts

Each row shows the XIAO pin number, the pin name used in the Arduino core (D0, A1…), the RP2040 GPIO number, and its functions, color-coded by peripheral. The square symbol means every pin is 3.3v only, the PWM symbol means every I/O can output PWM, and the numbered badges point to the notes at the bottom right of the diagram.

With the USB-C connector at the top, the left edge runs from D0 (pin 1) down to D6 (pin 7), and the right edge runs from D7 (pin 8, bottom) up to 5V (pin 14, top), counter-clockwise like Seeed’s own pin numbering. The pads are castellated, so you can solder the board flat onto a PCB, and the two rows are 15.24mm (600 mil) apart, so it fits a breadboard with headers. The XIAO RP2040 Plus has the same 14 edge pins; its 15 extra pads and battery pads aren’t on this diagram.

Buy a XIAO RP2040: If you don’t have one yet, you can get the genuine Seeed Studio board from Amazon or AliExpress. It drops into any XIAO expansion board, and it’s the cheapest way to get an RP2040 into a tiny project.

Download XIAO RP2040 Pinout Diagram (Full Resolution)

The XIAO RP2040 pinout diagram (edge pins, back-side pads, power, MCU and notes panels) in full resolution (5120×2600 px WebP), in one ZIP file. Print it, zoom in, or keep it next to your bench. Please consider supporting my work if it helped you.


XIAO RP2040 Datasheet

This development board is built around the Raspberry Pi RP2040 microcontroller (QFN-56). So the XIAO RP2040 datasheet set has two parts: Seeed Studio’s documents for the board, and Raspberry Pi’s for the chip. Here are the official documents you’ll need, linked to their original sources:

DocumentSourceRevisionWhat You’ll Use It ForLink
XIAO RP2040 wiki (getting started + specs)Seeed StudioonlineBoard specs, pin map, LEDs, Arduino and MicroPython setupWeb
XIAO RP2040 schematicSeeed Studiov1.3 (2022-05-24)The full board circuit (see the next section)PDF
XIAO RP2040 KiCad filesSeeed Studiov1.3 (package 2026-03-04)Schematic and PCB source, footprint for your own carrier boardZIP
XIAO RP2040 pinout sheetSeeed StudioonlineSeeed’s pin-by-pin function listXLSX
RP2040 datasheet (with errata)Raspberry PiRP-008371-DS, build 2025-02-20GPIO functions, electrical limits, ADC, PWM, every peripheral, and the errata (appendix)PDF
Hardware design with RP2040Raspberry PilatestReference circuit for the flash, crystal, USB and powerPDF
Arduino-Pico XIAO RP2040 variantEarle Philhower (GitHub)masterThe Arduino pin names (D0–D10, LED_BUILTIN, PIN_NEOPIXEL, Wire, SPI)Web

Which document do I need? The Seeed wiki for setup and the pin list, the schematic for what’s connected to each pin, and the RP2040 datasheet for the pin functions (its GPIO function table), the electrical limits, and register-level details. Seeed’s wiki links its own copy of the RP2040 datasheet; the Raspberry Pi link above always gets you the latest build.


XIAO RP2040 Schematic

The XIAO RP2040 schematic is Seeed Studio’s Seeed Studio XIAO RP2040 v1.3 drawing, dated 2022-05-24 (EAGLE; v1.1 and v1.2 changed only the LEDs). All the circuitry is on one sheet, so here is the full sheet followed by close-ups of each block; click a page to view it full screen.

XIAO RP2040 schematic page 1: full circuit sheet (XIAO RP2040 v1.3)
Page 1 of 7 · Full Sheet
XIAO RP2040 schematic page 2: USB-C connector, ESD diode, NRS0320 Schottky and RS3236 3.3v LDO (XIAO RP2040 v1.3)
Page 2 of 7 · USB-C, ESD, Schottky & RS3236 LDO
XIAO RP2040 schematic page 3: RP2040 microcontroller and its GPIO connections (XIAO RP2040 v1.3)
Page 3 of 7 · RP2040
XIAO RP2040 schematic page 4: GD25Q16 2MB QSPI flash, 12MHz crystal and BOOT button (XIAO RP2040 v1.3)
Page 4 of 7 · GD25Q16 Flash, 12MHz Crystal & BOOT Button
XIAO RP2040 schematic page 5: 3-colour user LED, red power LED and RESET button (XIAO RP2040 v1.3)
Page 5 of 7 · User LED, Power LED & RESET Button
XIAO RP2040 schematic page 6: WS2812 NeoPixel RGB LED powered from GPIO11 (XIAO RP2040 v1.3)
Page 6 of 7 · WS2812 NeoPixel LED
XIAO RP2040 schematic page 7: edge headers J2 and J4 (XIAO RP2040 v1.3)
Page 7 of 7 · Edge Headers J2 & J4
Page 1 of 4

Official source: the XIAO RP2040 schematic v1.3 (PDF) from the Seeed Studio wiki. Here’s what to look at:

  • USB input and the 5V pin: USB-C VBUS has a DF2S6.8FS ESD diode (D1) to ground and goes straight to the 5V edge pin. There’s no fuse and no diode between the connector and that pin.
  • Schottky diode and VIN: VBUS then passes through the NRS0320 Schottky diode (D2) to the VIN net, which is the VIN pad on the back. Anything you feed into VIN can’t flow back into USB.
  • 3.3v regulator: an RS3236-3.3 LDO (U4) turns VIN into the 3.3v rail for the RP2040, the flash, the LEDs and the 3V3 pin. It’s rated 500mA with an input up to 7.5v. Seeed’s wiki calls it a “DC-DC converter”, but it’s a linear regulator, so the extra voltage turns into heat.
  • RP2040 and flash: the RP2040 (U6) runs from a 12MHz crystal (X3) and boots from a GD25Q16 2MB QSPI flash (U3). USB D+/D− go through 27Ω resistors and a pair of ESD diodes (D6, D8) to the USB-C connector; there’s no USB-UART chip. ADC_AVDD is tied straight to the 3.3v rail, with no ADC_VREF pin.
  • BOOT button: B pulls QSPI_CS to GND through 1kΩ, which tells the RP2040’s ROM to start the USB bootloader instead of the flash program.
  • LEDs and RESET: the 3-colour user LED is common-anode on 3.3v, with its cathodes on GPIO17 (red, 4.7kΩ), GPIO16 (green, 11kΩ) and GPIO25 (blue, 2.2kΩ), so LOW turns it on. The red power LED sits on 3.3v through 1kΩ. RESET pulls RUN to GND (10kΩ pull-up, 100nF), and RUN is also a back pad (TP1).
  • NeoPixel: the WS2812 RGB LED (RGB1) gets its data from GPIO12 and its VCC from GPIO11 (net NEO_PWR), so the LED is dark until your code drives GPIO11 HIGH.

Note: Seeed’s back-side pinout image swaps the two bottom pads: it calls the left pad “VBUS” and the right pad “GND”. The silkscreen and Seeed’s own KiCad PCB file say the opposite: the left pad is GND and the right pad is VIN, the regulator input after the Schottky diode (not VBUS). Go by the silkscreen.

If you plan to put an RP2040 on your own PCB, my Raspberry Pi Pico (RP2040) Schematic & PCB Design in KiCAD tutorial walks through the same flash, crystal and USB circuit.


XIAO RP2040 Specs

The XIAO RP2040 is the smallest RP2040 board in the XIAO family. Here are its specifications, including the board-level parts that chip-only spec lists usually skip.

XIAO RP2040 development board (Seeed Studio, Raspberry Pi RP2040) with NeoPixel LED, BOOT and RESET buttons

Get a XIAO RP2040: The genuine Seeed Studio board is the one I recommend. Grab it from Amazon or AliExpress.

ItemXIAO RP2040
MCURaspberry Pi RP2040 (QFN-56)
CPUDual-core Arm Cortex-M0+, up to 133MHz
Memory264KB SRAM, 2MB QSPI flash (GD25Q16) on the board
Logic level3.3v on every pin, not 5v tolerant (max 3.3v + 0.5v on a pin)
GPIO pins11 (D0–D10), on 14 castellated edge pads
Analog inputs4 (A0–A3), 12-bit, 500ksps
Board supplyUSB-C 5v, the 5V pin, or the VIN pad on the back
3.3v regulatorRS3236-3.3 LDO: 500mA, input up to 7.5v
Pin current4mA default drive (2/4/8/12mA settable), 50mA total for all GPIOs
Clock12MHz crystal
USB connectorUSB-C to the RP2040’s USB 1.1 (device and host); no USB-UART chip
Buttons and LEDsBOOT, RESET, 3-colour user LED (active LOW), WS2812 NeoPixel, red power LED
DebugSWD on the back pads (SWCLK, SWDIO, RUN, GND)
Size21 × 17.8mm, XIAO form factor, surface-mountable
Seeed SKU102010428
Nobattery charger, DAC, Wi-Fi/Bluetooth, 5v-tolerant pins, ADC_VREF pin

XIAO RP2040 Specifications Summary

  • The XIAO RP2040 runs a dual-core RP2040 at up to 133MHz with 264KB SRAM and 2MB flash.
  • It has 11 GPIOs (D0–D10), and every pin is 3.3v only: none of them is 5v tolerant.
  • Each GPIO drives 4mA by default (up to 12mA), and all of them together must stay under 50mA.
  • It has 4 ADC pins: A0–A3 on D0–D3 (GPIO26–GPIO29). The ADC reference is the 3.3v rail; there’s no VREF pin.
  • All 11 GPIOs can output PWM, on 6 of the RP2040’s 8 PWM slices.
  • The I2C pins are D4 (SDA) and D5 (SCL), and they’re I2C1 (not I2C0) in the RP2040: I2C(1, sda=Pin(6), scl=Pin(7)) in MicroPython.
  • Serial1 is D6 (TX) / D7 (RX); SPI is D8 (SCK), D9 (MISO), D10 (MOSI).
  • The NeoPixel data pin is GPIO12, and GPIO11 must be HIGH to power it.
  • The user LED pins are GPIO17 (red, LED_BUILTIN), GPIO16 (green) and GPIO25 (blue), all active LOW.
  • The 5V pin is raw USB VBUS. Batteries and other supplies go on the VIN pad on the back, after the diode.
  • The 3V3 pin comes from a 500mA RS3236 LDO, shared with the board itself.
  • Hold B (BOOT) while plugging in USB to get the RPI-RP2 drive and drop a .uf2 file.

XIAO RP2040 Peripherals: RP2040 vs On the Pins

The RP2040 has a fixed pin map: each GPIO has one UART, one SPI, one I2C and one PWM function (Table 279 of the datasheet), plus the PIO blocks that can drive any pin. This table shows what the chip has and what you can actually reach on the XIAO edge.

PeripheralRP2040On the XIAO RP2040
GPIO30 GPIOs11 (D0–D10)
ADC12-bit SAR, 500ksps, 4 inputs + temperature sensorall 4 inputs (A0–A3)
PWM8 slices × 2 channels = 16 outputs11 pins on 6 slices
UART2UART0 on D6/D7 (or D2/D3); UART1 TX only (D9)
SPI2SPI0 on D8–D10 (+ D7 as CSn); SPI1 on D0–D3
I2C2I2C1 on D4/D5 (also D0/D1, D8/D10); I2C0 on D6/D7 or D2/D3
PIO2 blocks, 8 state machinesany pin (extra UARTs, WS2812, DVI…)
USBUSB 1.1 device/hostUSB-C connector only
SWD2-wire debugback pads SWCLK, SWDIO
DAC / Wi-Finone–

XIAO RP2040 Quick Pin Selection Guide

Not sure which pin to use? Here are the XIAO RP2040 pins I’d pick first for each job, and why.

Use CaseRecommended PinsWhy
Serial to the PCUSB-C (Serial)USB CDC on the RP2040’s own USB
Serial to a module (GPS, GSM…)D7 (RX), D6 (TX)UART0, the Arduino Serial1 pins
I2C sensors and displaysD4 (SDA), D5 (SCL)The Arduino Wire pins (I2C1), same place on every XIAO
SPI devicesD8 (SCK), D9 (MISO), D10 (MOSI), CS on D7 or any pinSPI0, the Arduino SPI pins
Analog inputsA0, A1, A2, A3The only ADC pins (D0–D3)
PWM (LEDs, servos)D9, then D4/D5 or D8/D10D9 has a slice to itself; pairs share a frequency
WS2812 / NeoPixel stripD10 or any free pinPIO drives them on any GPIO
On-board LEDGPIO17 / 16 / 25 (LOW = on)No wiring needed
DebuggingSWCLK, SWDIO back padsSWD with a Raspberry Pi Debug Probe
Safest general GPIOD4, D5, D8, D9, D10No ADC, no shared on-board load

XIAO RP2040 Pins to Use With Caution

PinReasonWhat to Do
All pins3.3v only, not 5v tolerantLevel-shift every 5v signal
All pins together50mA total GPIO current; 4mA default drive per pinDrive relays, motors and LED strips through a transistor or driver
D4 / D5I2C1 in hardware; Seeed’s docs say I2C0Use I2C1 (bus 1) outside the Arduino core
D6 / D7Same PWM channels (0A/0B) as the green/red user LEDOnly matters when both run PWM at once
D1 / D2Share PWM channels 5B/6A with NeoPixel power (GPIO11) and data (GPIO12)Avoid PWM on D1/D2 while you use the NeoPixel in PWM-heavy code
A0–A3ADC reference = 3.3v rail, no VREF; RP2040-E11 errataAverage readings; use an I2C ADC for precision
5VRaw USB VBUS, no diode or fuseNever feed 5v here with USB plugged in; use VIN instead
VIN padLinear regulator: dropout and heatFeed 3.8v–5.5v for a solid 3.3v; never with USB attached

XIAO RP2040 Pin Numbering: XIAO Pins vs GPIO Numbers

The XIAO RP2040 has three numbering systems on the same pins: the XIAO pin number (1–14, physical), the XIAO name (D0–D10), and the RP2040 GPIO number. In the Arduino-Pico core, a bare number is always the GPIO number, so digitalWrite(6, HIGH) drives GPIO6 = D4, not D6. MicroPython, CircuitPython’s board.GP names, and the Pico SDK use GPIO numbers too.

XIAO PinXIAO NameGPIO (Arduino-Pico Number)MicroPythonXIAO PinXIAO NameGPIO (Arduino-Pico Number)MicroPython
1D0 / A0GPIO26Pin(26)8D7 / RXGPIO1Pin(1)
2D1 / A1GPIO27Pin(27)9D8 / SCKGPIO2Pin(2)
3D2 / A2GPIO28Pin(28)10D9 / MISOGPIO4Pin(4)
4D3 / A3GPIO29Pin(29)11D10 / MOSIGPIO3Pin(3)
5D4 / SDAGPIO6Pin(6)123V3––
6D5 / SCLGPIO7Pin(7)13GND––
7D6 / TXGPIO0Pin(0)145V––

The safe habit is to write the pin names ( D4, A0, LED_BUILTIN) in Arduino sketches: the seeed_xiao_rp2040 variant of the Arduino-Pico core defines them all, so your code reads the same as the silkscreen. Older Seeed tutorials used a different, Mbed-based Arduino package (“Seeed XIAO RP2040” on the Arduino Mbed OS core), where the Serial and pin names don’t match Arduino-Pico. Seeed’s wiki now uses Earle Philhower’s Arduino-Pico core, and so does this guide.


XIAO RP2040 Pins Functions

The 14 edge pins of the XIAO RP2040 (plus the back pads) are divided into the following groups based on the hardware functionality they’re used for. Since every RP2040 GPIO has a UART, SPI, I2C and PWM function, most pins belong to several groups at once.

We’ll discuss each pin group in the following sections one by one in more detail.


XIAO RP2040 Power Pins

The XIAO RP2040 is powered from the USB-C port (5v), from the 5V pin, or from the VIN pad on the back. The 3V3 pin is the RS3236 regulator’s output, and the 5V pin is the raw USB VBUS line. The power pins are highlighted in red in the pinout diagram.

XIAO RP2040 power pins (5V USB VBUS, 3V3 output, GND)

PinXIAO PinRangeNotes
5V145v in/outUSB VBUS before the Schottky diode: 5v out on USB power; no fuse
3V3123.3v outRS3236 LDO output, 500mA shared with the RP2040, flash and LEDs
GND130vPlus the two GND pads on the back
VINback padup to 7.5v (RS3236 input)Regulator input after the Schottky diode; battery or external supply

How to power the XIAO RP2040 from a battery? There’s no charger on this board (that’s the XIAO RP2040 Plus). Solder your supply to the VIN and GND pads at the bottom of the back side. Because VIN sits after the Schottky diode, the battery can’t push current back into USB, but Seeed still says not to connect USB while a battery is connected. Three AA cells (4.5v) or a 5v power bank cable work well.

A single 3.7v LiPo works too, but only at light loads. The RS3236 needs some headroom above 3.3v (about 0.6v at its full 500mA), so as the cell drains below about 3.8v, the 3.3v rail sags with it. The board keeps working a little below 3.3v (the flash chip needs 2.7v), so it’s fine for low-current projects, not for loads near 500mA.

Note: The 5V pin is wired straight to the USB-C connector’s VBUS, with no diode and no fuse. Feeding 5v into it while USB is plugged in back-feeds your PC’s USB port. Use the VIN pad for an external supply, or put a Schottky diode in series with your supply on the 5V pin.


XIAO RP2040 GPIO Pins

The XIAO RP2040 has 11 GPIO pins: D0–D10 (GPIO0–GPIO4, GPIO6, GPIO7, and GPIO26–GPIO29). They all work at 3.3v, and none of them is 5v tolerant. Every one of them can be a digital input, a digital output, a PWM output, or an interrupt source.

XIAO RP2040 GPIO pins (D0-D10) with their RP2040 GPIO numbers

Each GPIO can be an input (floating, or with its internal pull-up or pull-down) or an output, with a programmable drive strength. Here are the electrical limits (RP2040 datasheet RP-008371-DS):

  • Logic level 3.3v; never apply more than 3.3v + 0.5v to any pin.
  • Drive strength per pin: 2mA, 4mA, 8mA or 12mA, with 4mA by default. The RP2040 does its best to hold the pin HIGH or LOW at that current; a bigger load just pulls the voltage away.
  • All GPIOs together must stay under 50mA of source or sink current. So an LED at 10mA on each of the 11 pins is already too much.
  • Every GPIO can trigger an interrupt: attachInterrupt(digitalPinToInterrupt(D2), isr, FALLING) works on any of the 11 pins.
  • The GPIOs you don’t see: GPIO11/12 (NeoPixel), GPIO16/17/25 (user LED); GPIO5, GPIO8–10, GPIO13–15 and GPIO18–24 aren’t connected at all.

To get more than 4mA from a pin in the Arduino-Pico core, call the Pico SDK function, which the core includes:

Learn more in our Raspberry Pi Pico GPIO Tutorial.


XIAO RP2040 ADC Pins

The XIAO RP2040 has 4 ADC pins: A0 (D0), A1 (D1), A2 (D2) and A3 (D3), which are GPIO26–GPIO29, the RP2040’s four external ADC inputs. The ADC is 12-bit at up to 500ksps, and its reference is the board’s 3.3v rail. The ADC pins are highlighted in green in the pinout diagram.

XIAO RP2040 ADC pins (A0 GPIO26, A1 GPIO27, A2 GPIO28, A3 GPIO29)

PinGPIOADC ChannelMicroPython
A0 / D0GPIO26ADC0ADC(0) or ADC(Pin(26))
A1 / D1GPIO27ADC1ADC(1)
A2 / D2GPIO28ADC2ADC(2)
A3 / D3GPIO29ADC3ADC(3)

In the Arduino-Pico core, analogRead() returns 10-bit values (0–1023) by default; call analogReadResolution(12) for the full 0–4095 range (Arduino-Pico analog docs). Unlike the Raspberry Pi Pico, the XIAO RP2040 has no ADC_VREF pin: the RP2040’s ADC_AVDD is tied straight to the 3.3v rail, so the reference moves with the LDO output and picks up its noise.

Note: The RP2040 ADC has a known non-linearity (erratum RP2040-E11): codes near 512, 1536, 2560 and 3584 are wider than the rest, so the real resolution is about 8.7 effective bits. Average several readings, and use an external I2C ADC (ADS1115) when you need precision. There’s no way to add an external reference on this board (Seeed forum).

There are so many sensors that we can read with the ADC pins, which include: potentiometers, LDRs, NTC thermistors, soil moisture sensors, joysticks, battery dividers, and much more.


XIAO RP2040 PWM Pins

All 11 GPIO pins on the XIAO RP2040 can output PWM. The RP2040 has 8 PWM slices with two channels each (A and B), and every GPIO is hard-wired to one channel. The two channels of a slice share the same frequency but keep their own duty cycle. The PWM pins are highlighted in the pinout diagram.

XIAO RP2040 PWM pins (D0-D10 on PWM slices 0, 1, 2, 3, 5 and 6)

XIAO RP2040 PWM Pins: D0–D10, on 6 slices.

PinGPIOPWM ChannelShares the Slice With
D0 / D1GPIO26 / GPIO275A / 5Beach other; 5B is also GPIO11 (NeoPixel power)
D2 / D3GPIO28 / GPIO296A / 6Beach other; 6A is also GPIO12 (NeoPixel data)
D4 / D5GPIO6 / GPIO73A / 3Beach other
D6 / D7GPIO0 / GPIO10A / 0Beach other; also GPIO16 / GPIO17 (green / red LED)
D8 / D10GPIO2 / GPIO31A / 1Beach other
D9GPIO42Anothing on the board

In the Arduino-Pico core, analogWrite(D9, 128) just works (8-bit by default, 1kHz). Use analogWriteFreq() and analogWriteRange() to change the frequency and resolution. For two outputs at different frequencies, pick pins on different slices, for example D9 and D4.

Note: Pins on the same channel output the same signal. D6 and the green user LED (GPIO16) are both channel 0A, so if you run PWM on D6 and also on the green LED, they can’t have different duty cycles. The same goes for D1 and the NeoPixel power pin (5B), and D2 and the NeoPixel data pin (6A). It only matters when both pins are in PWM mode at the same time.

There are so many things that we can control with PWM, which include: LED dimming, RGB LEDs, DC motor speed (with a driver), servo motors, buzzers, and much more.


XIAO RP2040 UART Pins

The XIAO RP2040 has one fully usable hardware UART on the edge: UART0 on D6 (TX) and D7 (RX), which is Serial1 in the Arduino-Pico core. Serial is the USB-C port (USB CDC). UART1 only has its TX on the edge (D9), so Serial2 isn’t pinned out. The UART pins are highlighted in blue in the pinout diagram.

XIAO RP2040 UART pins (D6 TX GPIO0, D7 RX GPIO1, alternate UART0 on D2/D3)

XIAO RP2040 Default UART Pins: D6 (TX) and D7 (RX) for Serial1.

PortArduino ObjectTX PinRX PinNote
USB CDCSerialUSB-CUSB-CThe Serial Monitor port
UART0Serial1D6 (GPIO0)D7 (GPIO1)Default pins
UART0 (alternate)Serial1D2 (GPIO28)D3 (GPIO29)Set with setTX()/setRX() before begin()
UART1Serial2D9 (GPIO4)–No RX on the edge; use PIO SerialPIO for a 2nd port

To move Serial1, call setTX() and setRX() before begin(), and only with pins that really are UART0 pins (Arduino-Pico Serial docs):

Note: An invalid pin in setTX()/ setRX() (one that isn’t a UART0 pin) makes the core panic, and the USB port disappears from your PC with it (arduino-pico discussion). If that happens, hold B while plugging in USB and upload a fixed sketch.

There are so many modules that we can interface with the UART pins, which include: GPS modules, GSM/LTE modules, fingerprint sensors, RS485 transceivers, DFPlayer Mini, other microcontrollers, and much more.

Learn more in our Raspberry Pi Pico Serial Over USB Tutorial.


XIAO RP2040 I2C Pins

The XIAO RP2040 I2C pins are D4 (SDA) and D5 (SCL), the same place as on every XIAO board, so Grove and XIAO expansion boards work out of the box. In the RP2040, GPIO6 and GPIO7 belong to I2C1, not I2C0. The I2C pins are highlighted in yellow in the pinout diagram.

XIAO RP2040 I2C pins (D4 SDA GPIO6, D5 SCL GPIO7 on I2C1)

XIAO RP2040 Default I2C Pins: D4 (SDA) and D5 (SCL), on I2C1.

SignalPinGPIORP2040 Controller
SDAD4GPIO6I2C1
SCLD5GPIO7I2C1
SDA / SCL (alternate)D6 / D7 or D2 / D3GPIO0/1, GPIO28/29I2C0

Seeed’s wiki and its front pinout image label D4/D5 as “SDA0/SCL0”, which sends a lot of people to the wrong controller (Seeed forum, Klipper forum). The Arduino-Pico core already maps Wire to I2C1 on D4/D5, so Wire.begin() just works. Outside Arduino, ask for bus 1:

Note: There are no I2C pull-up resistors on the XIAO RP2040, so add 4.7kΩ pull-ups to 3.3v (not 5v) unless your module already has them. Most breakout boards do.

There are so many modules and sensors that we can interface with the I2C bus, which include: OLED displays (SSD1306), RTC modules (DS3231), IMUs (MPU6050), BME280 sensors, port expanders, and much more.


XIAO RP2040 SPI Pins

The XIAO RP2040 default SPI pins are D8 (SCK), D9 (MISO) and D10 (MOSI) on the RP2040’s SPI0. The core’s SS isn’t pinned out, so choose your own CS pin (D7 is SPI0’s hardware CSn). A second port, SPI1, is on D0–D3. The SPI pins are highlighted in pink in the pinout diagram.

XIAO RP2040 SPI pins (D8 SCK GPIO2, D9 MISO GPIO4, D10 MOSI GPIO3)

XIAO RP2040 Default SPI Pins: D8 (SCK), D9 (MISO), and D10 (MOSI), with CS on a pin you choose.

SignalSPI0 (Arduino SPI)GPIOSPI1 (alternate)
SCKD8GPIO2D0 (GPIO26)
MISO (RX)D9GPIO4D2 (GPIO28)
MOSI (TX)D10GPIO3D1 (GPIO27)
CSany pin (D7 = CSn)GPIO1D3 (GPIO29)

With SPI1 on the ADC pins, you trade analog inputs for a second SPI bus, which is handy when a display and an SD card need separate buses. There are so many modules that we can interface with the SPI bus, which include: TFT displays (ST7789, GC9A01), SD card modules, LoRa radios (SX1276), nRF24L01 radios, MAX7219 LED drivers, and much more.


XIAO RP2040 LED & NeoPixel Pins

The XIAO RP2040 has a 3-colour user LED on GPIO17 (red), GPIO16 (green) and GPIO25 (blue), and a WS2812 NeoPixel with its data on GPIO12 and its power on GPIO11. None of them is on an edge pin. In the Arduino-Pico core, LED_BUILTIN is 17 (red), PIN_NEOPIXEL is 12, and NEOPIXEL_POWER is 11.

LEDGPIOArduino NameOn When
User LED redGPIO17LED_BUILTIN, PIN_LED_RLOW
User LED greenGPIO16PIN_LED_GLOW
User LED blueGPIO25PIN_LED_BLOW
NeoPixel dataGPIO12PIN_NEOPIXELWS2812 protocol
NeoPixel powerGPIO11NEOPIXEL_POWERHIGH = powered
Power LED (red)3.3v rail–Always on

The user LED is common-anode, so it’s active LOW: digitalWrite(LED_BUILTIN, LOW) turns it on, the opposite of a Pico or an Arduino UNO. The three colours also have different resistors, so green looks dimmer than red and blue.

The NeoPixel stays dark until GPIO11 is HIGH, because GPIO11 is its supply. That’s the number one “my NeoPixel doesn’t work” problem on this board, and some reviews even give the wrong power pin (GPIO10). Here’s a working sketch with the Adafruit NeoPixel library:

Tip: In MicroPython, do the same with Pin(11, Pin.OUT).value(1) and neopixel.NeoPixel(Pin(12), 1). If the NeoPixel still stays dark, check that nothing in your code drives GPIO11 LOW again (Seeed forum).


XIAO RP2040 SWD & Boot Pins

The XIAO RP2040 has its SWD debug pins on the back: SWCLK and SWDIO, with RUN (reset) and GND next to them, near the USB-C connector. The B (BOOT) and R (RESET) buttons on the front start the USB bootloader and reset the chip.

Pad / ButtonSignalUse
SWCLK pad (TP3)RP2040 SWCLKSWD clock
SWDIO pad (TP5)RP2040 SWDIOSWD data
RUN pad (TP1)RUN (10kΩ pull-up)Reset: LOW = chip in reset
GND padsGNDProbe ground
B buttonQSPI_CS to GND via 1kΩHold at power-up or reset = USB bootloader (RPI-RP2)
R buttonRUN to GNDReset

Seen from the back with USB-C at the top, the SWD pads form a 2×2 group: SWCLK (left) and SWDIO (right) on top, GND (left) and RUN (right) below them. Solder thin wires to them and connect a Raspberry Pi Debug Probe, a second Pico running debugprobe (picoprobe), or a J-Link, then debug with OpenOCD and GDB, or from VS Code with the Raspberry Pi Pico extension.

XIAO RP2040 Bootloader Steps (RPI-RP2)

The RP2040’s USB bootloader lives in its ROM, so it can’t be erased: whatever your sketch did, these steps always bring the XIAO RP2040 back (Seeed forum):

  1. Hold B (BOOT) and plug in the USB cable, or hold B and tap R.
  2. Release B. A USB drive named RPI-RP2 appears on your PC.
  3. Drop a .uf2 file on it (MicroPython, CircuitPython, or a compiled sketch), or simply upload from the Arduino IDE: it finds the drive by itself.

Note: During every Arduino upload, the COM port disappears and the RPI-RP2 drive shows up for a moment: the core reboots the board into the bootloader to flash it. That’s normal. If the IDE then can’t find a port at all, pick the “UF2 Board” port, or use the steps above once.


Getting Started With XIAO RP2040

You can program the XIAO RP2040 with the Arduino IDE, MicroPython, CircuitPython, the Pico SDK (C/C++), PlatformIO, TinyGo, Rust or Zephyr, all over the USB-C cable. No external programmer is needed.

  • Arduino IDE: add https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json to the Boards Manager URLs, install “Raspberry Pi Pico/RP2040” by Earle F. Philhower, then select Seeed XIAO RP2040.
  • MicroPython / CircuitPython: flash the XIAO RP2040 (or generic RP2040) build through the RPI-RP2 drive and use the GPIO numbers: Pin(17) is the red LED.
  • Pico SDK (C/C++): use PICO_BOARD=seeed_xiao_rp2040, which sets up the right flash and the LED pins.
  • PlatformIO: the Arduino-Pico core through the community “raspberrypi” platform fork, board seeed_xiao_rp2040.
Arduino NamePinDefault
SerialUSB-CUSB CDC
Serial1D6 (TX), D7 (RX)UART0
WireD4 (SDA), D5 (SCL)I2C1
SPID8 / D9 / D10SPI0; choose your own CS
A0–A3D0–D3ADC0–ADC3 (10-bit by default)
LED_BUILTINGPIO17Red user LED, active LOW
PIN_NEOPIXEL / NEOPIXEL_POWERGPIO12 / GPIO11WS2812 data / power

Since the XIAO RP2040 runs the same chip and core as the Raspberry Pi Pico, almost every Pico tutorial applies to it: just swap in the XIAO pin names, and remember that the Pico’s LED on GPIO25 is the blue (active LOW) LED here.


XIAO RP2040 Common Problems & Fixes

Why doesn’t my I2C sensor respond? D4/D5 are I2C1. In MicroPython or the Pico SDK, use bus 1 ( I2C(1, sda=Pin(6), scl=Pin(7))). In Arduino, update the Arduino-Pico core (old versions had a wrong variant) and check the pull-ups.

Why does my NeoPixel stay dark? Drive GPIO11 HIGH first: it powers the LED. The data pin is GPIO12.

Why is the LED on when I write LOW? The 3-colour user LED is common-anode on 3.3v, so it’s active LOW. That’s by design.

Why did the COM port disappear? During an upload it’s normal. If it doesn’t come back, your sketch probably crashed (an invalid Serial1 pin, for example): hold B while plugging in USB and upload again.

Why are my analog readings noisy? The ADC reference is the 3.3v rail (no VREF pin), and the RP2040 has the E11 non-linearity. Average readings, add a 100nF cap on the input, or use an I2C ADC.

Can I power it from a LiPo? Yes, on the VIN pad (not the 5V pin), with no USB attached. There’s no charger, and the LDO’s dropout limits it to light loads as the cell drains.

Is the XIAO RP2040 5v tolerant? No. Every pin is 3.3v only. Use a level shifter or a divider for 5v signals.

Why don’t the pin names from an old tutorial work? It was written for the Mbed-based Seeed package. With Arduino-Pico, use D0–D10 or the GPIO numbers from the table above.


XIAO RP2040 vs XIAO RP2040 Plus vs XIAO RP2350 vs Raspberry Pi Pico

The XIAO RP2040 has three close relatives: Seeed’s XIAO RP2040 Plus (same chip, more pads and a charger), Seeed’s XIAO RP2350 (the newer chip in the same footprint), and the Raspberry Pi Pico (same chip, bigger board). Here’s how they compare:

FeatureXIAO RP2040XIAO RP2040 PlusXIAO RP2350Raspberry Pi Pico
MCURP2040, 2× M0+ 133MHzRP2040, 2× M0+ 133MHzRP2350, 2× M33 150MHzRP2040, 2× M0+ 133MHz
SRAM / flash264KB / 2MB264KB / 2MB520KB / 2MB264KB / 2MB
GPIO1126 (15 extra pads)19 (8 back pads)26
ADC pins4 (A0–A3)43 on the edge3 (+ VREF pin)
Battery chargerNoYesYesNo
5v-tolerant pinsNoNoYes (non-ADC, when powered)No
I2C on D4/D5I2C1 (Wire)I2C1I2C1 (Wire1)–
Size21 × 17.8mm21 × 17.8mm21 × 17.8mm51 × 21mm

Pick the XIAO RP2040 for the smallest, cheapest RP2040 build, especially on a XIAO expansion board. Pick the Plus when you need more pins or a LiPo charger in the same footprint, the XIAO RP2350 for more RAM, speed and 5v-tolerant pins, and the Pico when you want 26 GPIOs on a breadboard and an ADC_VREF pin. For the Pico’s pins, check out my Raspberry Pi Pico & Pico W Pinout Guide.


XIAO RP2040 Pin Details

Here is every XIAO RP2040 pin in physical order, with its GPIO, main functions, all its RP2040 functions, and a short description. With the USB-C connector at the top, pin 1 (D0) is the top-left pad, pins 1–7 run down the left edge, and pins 8–14 run up the right edge.

Click to expand the full pin table (18 pins)
PinLabelGPIOMain FunctionsAll Alternate Functions5v TolerantDescription
1D0 / A0GPIO26ADC0PWM5 A, SPI1 SCK, UART1 CTS, I2C1 SDANo (3.3v)Analog input A0, or a digital pin; shares PWM slice 5 with D1.
2D1 / A1GPIO27ADC1PWM5 B, SPI1 TX, UART1 RTS, I2C1 SCLNo (3.3v)Analog input A1; its PWM channel is the same as the NeoPixel power pin (GPIO11).
3D2 / A2GPIO28ADC2PWM6 A, SPI1 RX, UART0 TX, I2C0 SDANo (3.3v)Analog input A2 and an alternate UART0 TX; PWM channel shared with the NeoPixel data pin.
4D3 / A3GPIO29ADC3PWM6 B, SPI1 CSn, UART0 RX, I2C0 SCLNo (3.3v)Analog input A3 and an alternate UART0 RX.
5D4 / SDAGPIO6I2C1 SDA (Wire)PWM3 A, SPI0 SCK, UART1 CTSNo (3.3v)The default I2C data pin, on I2C1 (not I2C0).
6D5 / SCLGPIO7I2C1 SCL (Wire)PWM3 B, SPI0 TX, UART1 RTSNo (3.3v)The default I2C clock pin, on I2C1.
7D6 / TXGPIO0UART0 TX (Serial1)PWM0 A, SPI0 RX, I2C0 SDANo (3.3v)Serial1 transmit; same PWM channel as the green user LED.
8D7 / RXGPIO1UART0 RX (Serial1)PWM0 B, SPI0 CSn, I2C0 SCLNo (3.3v)Serial1 receive, and SPI0’s hardware CS; same PWM channel as the red user LED.
9D8 / SCKGPIO2SPI0 SCKPWM1 A, UART0 CTS, I2C1 SDANo (3.3v)The default SPI clock pin.
10D9 / MISOGPIO4SPI0 RX (MISO)PWM2 A, UART1 TX, I2C0 SDANo (3.3v)The default SPI data-in pin, with a PWM slice to itself.
11D10 / MOSIGPIO3SPI0 TX (MOSI)PWM1 B, UART0 RTS, I2C1 SCLNo (3.3v)The default SPI data-out pin; a good free pin for an LED or a NeoPixel strip.
123V3–3.3v output––RS3236 regulator output, 500mA shared with the board.
13GND–Ground––Ground.
145V–USB VBUS––5v straight from the USB-C connector, before the diode; no fuse.
backSWCLK / SWDIO–SWD––Serial Wire Debug pads for a debug probe.
backRUN–Reset––Pull LOW to reset the RP2040, like the R button.
backVIN–Supply input––Regulator input after the Schottky diode: battery or external supply.
backGND (×2)–Ground––Ground pads next to SWD and next to VIN.

Every GPIO also has the SIO function (plain digital I/O) and the PIO0/PIO1 functions, so the PIO state machines can drive any of the 11 pins.


Wrap Up

To conclude this guide article, the XIAO RP2040 is a very solid board for small projects that need a fast, cheap, well-supported microcontroller. It gives you a dual-core 133MHz RP2040, 11 GPIOs, 4 analog inputs, and two programmable LEDs on a board the size of your thumbnail. Just remember the board-level gotchas: every pin is 3.3v only, D4/D5 are I2C1, the NeoPixel needs GPIO11 HIGH, the user LED is active LOW, and the 5V pin is raw USB VBUS.

I hope you’ve found this guide helpful for your project. For more boards, check out the Pinouts, Datasheets & Schematic Diagrams Library. Follow this Raspberry Pi Pico Series of Tutorials to learn more about programming RP2040 boards.

If you’re just getting started with the RP2040, you need to check out the Raspberry Pi Pico Getting Started Ultimate Guide below.

Getting Started With Raspberry Pi Pico (And Pico W)

The complete beginner’s guide to the Raspberry Pi Pico and the RP2040: setting up MicroPython, your first project, and the Pico tutorials series step by step.

Share This Page With Your Network!
Join Our +25,000 Newsletter Subscribers!

Stay Updated With All New Content Releases. You Also Get Occasional FREE Coupon Codes For Courses & Other Stuff!

Photo of author
Author
Embedded systems engineer with several years of experience in embedded software and hardware design. I work as an embedded SW engineer in the Automotive & e-Mobility industry. However, I still do Hardware design and SW development for DSP, Control Systems, Robotics, AI/ML, and other fields I'm passionate about.
I love reading, writing, creating projects, and teaching. A reader by day and a writer by night, it's my lifestyle. I believe that the combination of brilliant minds, bold ideas, and a complete disregard for what is possible, can and will change the world! I will be there when it happens, will you?

Leave a Comment