Skip to main content

Seeed Studio XIAO RP2350 with Arduino

The Seeed Studio XIAO RP2350 board now supports programming via Arduino, thanks to the arduino-pico core. This guide will help you set up and begin using Arduino on your RP2350 board.

Features

  • Powerful MCU Board: Equipped with a Raspberry Pi RP2350 chip featuring symmetric dual Arm Cortex-M33 @ 150MHz with FPU.
  • Enhanced Security Features: Built-in secure boot and encrypted bootloader ensure application security.
  • Software Support: Compatible with C/C++ and MicroPython, ensuring easy project development and prototyping.
  • Rich Onboard Resources: Integrates an RGB LED, 2MB Flash, 520kB SRAM, and 19 multifunction GPIOs(Analog, Digital, I²C, UART, SPI, PWM).
  • Expanded 8 New IOs: Compared to previous XIAO MCUs, the addition of 8 IO pins on the back supports more complex applications.
  • Efficient Power Design: Ultra-low power consumption of just 50μA in sleep mode, enabling battery power supply. Direct battery voltage measurement via internal IO enhances the battery management system (BMS).
  • Compact Thumb-Sized Design: Measuring 21 x 17.8mm, adopting Seeed Studio's classic XIAO form factor, ideal for space-conscious applications.
  • Production-friendly: Surface Mount Device (SMD) design with all components on the front and stamp holes on both sides, facilitating efficient mass production.

Specification

ProductXIAO RP2040XIAO RP2350
ProcessorRaspberry Pi RP2040
Dual Cortex-M0+ @ 133MHz
Raspberry Pi RP2350
Dual Cortex-M33 @ 150MHz, FPU
RAM264kB SRAM520kB SRAM
Flash2MB Onboard2MB Flash
LEDs1x user LED
1x power LED
1x RGB LED
1x user LED
1x power LED
1x RGB LED
Interface11 Pins (All PWM):
4x Analog
11x Digital
1x I²C
1x UART
1x SPI
19 Pins (All PWM):
3x Analog
19x Digital
2x I²C
2x UART
2x SPI
Button1x RESET button
1x BOOT button
1x RESET button
1x BOOT button
Security-OTP, Secure Boot, Arm TrustZone
Software compatibilitySupport Micropython / Arduino / CircuitPythonSupport Micropython / Arduino / C,C++
Working Temperature-20°C-70°C-20°C-70°C
Dimensions21x17.8 mm21x17.8 mm

Hardware Overview

XIAO RP2350 Front Pinout
XIAO RP2350 Front Pinout
XIAO RP2350 Back Pinout
XIAO RP2350 Back Pinout
XIAO RP2350 Components
XIAO RP2350 Components

Need more details on pinouts? Navigate to Assets and Resources below.

Pin Map

XIAO PinFunctionChip PinAlternate FunctionsDescription
5VVBUSPower Input/Output
GND
3V33V3_OUTPower Output
D0AnalogGPIO26GPIO, ADC
D1AnalogGPIO27GPIO, ADC
D2AnalogGPIO28GPIO, ADC
D3SPI0_CSnGPIO5GPIO, SPI
D4SDA1GPIO6GPIO, I2C Data
D5SCL1GPIO7GPIO, I2C Clock
D6TX0GPIO0GPIO, UART Transmit
D7RX0GPIO1GPIO, UART Receive
D8SPI0_SCKGPIO2GPIO, SPI Clock
D9SPI0_MISOGPIO4GPIO, SPI Data
D10SPI0_MOSIGPIO3GPIO, SPI Data
D11RX1GPIO21GPIO, UART Receive
D12TX1GPIO20GPIO, UART Transmit
D13SCL0GPIO17GPIO, I2C Clock
D14SDA0GPIO16GPIO, I2C Data
D15SPI1_MOSIGPIO11GPIO, SPI Data
D16SPI1_MISOGPIO12GPIO, SPI Data
D17SPI1_SCKGPIO10GPIO, SPI Clock
D18SPI1_CsnGPIO9Csn
ADC_BATGPIO29Read the BAT voltage value
ADC_BAT_ENGPIO19BAT voltage detect enable
ResetRUNRUN
BootRP2040_BOOTEnter Boot Mode
CHARGE_LEDNCHGCHG-LED_Red
RGB LEDGPIO22RGB LED
USER_LEDGPIO25User Light_Yellow

Prerequisites

To get started, ensure you have:

  • An RP2350 board
  • The Arduino IDE
  • A USB cable

Setting Up the Software

1. Install the Arduino IDE

Download and install the latest Arduino IDE from the official site: Arduino Software.

2. Add RP2350 Board Support

  1. Open the Arduino IDE and navigate to File > Preferences.

  2. In the Additional Boards Manager URLs field, add this URL:

    https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  3. Click OK to save your settings.

  4. Go to Tools > Board > Boards Manager.

  5. In the Boards Manager, search for pico and click Install.

  6. After installation, go to Tools > Board and select the board shown below as your board.

note

Ensure you install version 4.2.0 or later for full support of the XIAO RP2350 board.

3. Uploading a Sketch

Before uploading a sketch, place your XIAO RP2350 into BOOT mode. Use one of the methods below:

Hold Boot-> Plug in Cable-> Release Boot
  1. Open the Arduino IDE and create a new sketch.
  2. Write your code. For example, use the Blink example code.
  3. Go to Tools > Port and select the port where your RP2350 is connected.

Low Power Performance Verification

The power supply design of XIAO RP2350 delivers excellent performance in low-power scenarios and can be widely applied to various low-power applications.

Battery Connection

The XIAO RP2350 can be powered by a 3.7V lithium battery. You can refer to the diagram below for wiring.

pir
caution

Please be careful not to short-circuit the positive and negative terminals and burn the battery and equipment when soldering.

Flash the firmware

In the battery sampling circuit of the XIAO RP2350, a voltage sampling solution based on the SX1801CCR is adopted. A voltage divider circuit is formed by two 470 kΩ resistors, resulting in a voltage division ratio of 2. The program uses 3.3 V as the reference voltage, and the actual battery voltage can be calculated through the voltage restoration formula.

The following example uses a watchdog-reboot approach to simulate deep sleep since the Arduino IDE cannot easily integrate the pico-extras library required for true deep sleep.

Program
#include <Arduino.h>
#include "hardware/powman.h"
#include "hardware/adc.h"
#include "hardware/watchdog.h"

// ── Pin Definitions ──────────────────────────────────────────────
#define BAT_ADC_EN 19
#define BAT_ADC_READ 29
#define SLEEP_SEC 30

#define VOLTAGE_DIVIDER_RATIO 2.0f
#define VBAT_LOW_THRESHOLD 3.5f
#define SCRATCH_MAGIC 0xDEADBEEF

// ── Global voltage storage (can be output via other methods, e.g., LED alert) ──────────
static float g_vbat = 0.0f;
static bool g_lowBat = false;

// ── Disable ADC Peripheral ──────────────────────────────────────
static void disableADC() {
adc_run(false);
hw_clear_bits(&adc_hw->cs, ADC_CS_EN_BITS);
}

// ── Read Battery Voltage ─────────────────────────────────────────
static float readVbat() {
digitalWrite(BAT_ADC_EN, HIGH);
delayMicroseconds(500);

adc_init();
adc_gpio_init(BAT_ADC_READ);
adc_select_input(3);
analogReadResolution(12);
(void)analogRead(BAT_ADC_READ); // Discard the first reading

int32_t sum = 0;
for (int i = 0; i < 5; i++) {
sum += analogRead(BAT_ADC_READ);
delayMicroseconds(200);
}

digitalWrite(BAT_ADC_EN, LOW); // ★ Disable voltage divider immediately after sampling
disableADC();

return ((float)sum / 5.0f / 4095.0f * 3.3f) * VOLTAGE_DIVIDER_RATIO;
}

// ── Shut Down All Unnecessary Peripherals ─────────────────────────
static void shutdownPeripherals() {
// ADC
digitalWrite(BAT_ADC_EN, LOW);
disableADC();

// Pull down all unused pins to eliminate floating leakage
const uint8_t unused[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18};
for (uint8_t pin : unused) {
pinMode(pin, INPUT_PULLDOWN);
}

// Reduce frequency to 18MHz to significantly reduce dynamic power consumption
set_sys_clock_khz(18000, false);
}

// ── Low-Power Wait (Watchdog Reboot to Simulate Sleep) ───────────
static void sleepWithReboot(uint32_t seconds) {
// Start POWMAN Timer (LPOSC 1kHz)
if (!powman_timer_is_running()) powman_timer_start();
powman_timer_set_1khz_tick_source_lposc();

// Store wake-up target time in scratch registers
uint64_t wake_ms = powman_timer_get_ms() + (uint64_t)seconds * 1000ULL;
watchdog_hw->scratch[4] = SCRATCH_MAGIC;
watchdog_hw->scratch[5] = (uint32_t)(wake_ms & 0xFFFFFFFF);
watchdog_hw->scratch[6] = (uint32_t)(wake_ms >> 32);

shutdownPeripherals();

// Watchdog timeout reboot (max 8.3s), CPU waits in low-frequency WFE
rp2040.wdt_begin(8300);
while (true) {
__wfe();
}
}

// ─────────────────────────────────────────────────────────────────
void setup() {
// First action on power-up: pull ADC_EN low
pinMode(BAT_ADC_EN, OUTPUT);
digitalWrite(BAT_ADC_EN, LOW);
pinMode(BAT_ADC_READ, INPUT);

// ── Check if waking up from sleep reboot ───────────────────────
if (watchdog_hw->scratch[4] == SCRATCH_MAGIC) {
if (!powman_timer_is_running()) powman_timer_start();
powman_timer_set_1khz_tick_source_lposc();

uint64_t wake_ms = (uint64_t)watchdog_hw->scratch[5]
| ((uint64_t)watchdog_hw->scratch[6] << 32);
uint64_t now_ms = powman_timer_get_ms();

if (now_ms < wake_ms) {
// Not time to wake up yet, continue waiting
sleepWithReboot((uint32_t)((wake_ms - now_ms) / 1000 + 1));
// Will not return
}

// Time to wake up, clear flag
watchdog_hw->scratch[4] = 0;
}

// ── Restore normal frequency, execute application logic ───────
set_sys_clock_khz(125000, true);

// Sample voltage
g_vbat = readVbat();
g_lowBat = (g_vbat < VBAT_LOW_THRESHOLD);

// TODO: Process sampling results here
// Example: Turn on LED alert for low battery
// if (g_lowBat) { digitalWrite(LED_PIN, HIGH); delay(100); ... }

// Enter sleep mode 2 seconds after power-up
delay(2000);
}

void loop() {
sleepWithReboot(SLEEP_SEC);
// Will not return; restarts from setup() after wake-up
}

Then you can upload the program.

Alternatively, you can use our pre-written firmware for verification and performance testing.

Download XIAO RP2350 Low Power Test Firmware, drag it into the file system.

pir

Result

After instrumental testing and verification, the average current of the XIAO RP2350 is 53 μA when entering low-power mode.

pir

tip
  1. The average current in low-power mode measured by different instruments may vary. Please refer to the actual test results.
  2. This test result is obtained after flashing the low-power test firmware.
  3. For power consumption testing, the test wiring shall be connected to the BAT interface on the back side.
  4. Since the Arduino IDE has difficulty integrating the pico-extras library (which contains pico/sleep.h required for deep sleep), it is recommended to use the Pico SDK or the PlatformIO + arduino-pico framework for ultra-low-power development.

Assets & Resources

Hardware Design

Mechanical Design

Software & Tools

Others

Support & Discussion

Thank you for using Seeed products! We offer multiple channels for support and community discussion:

Loading Comments...