Skip to main content

Raspberry Pi Pico Simulation

The Raspberry Pi Pico is an RP2040 microcontroller board with a dual-core ARM Cortex-M0+ processor, 264KB of internal RAM, and flexible Programmable I/O (PIO). It runs at 125 MHz.


Getting Started

Place a Raspberry Pi Pico on the canvas and open the code editor by clicking on the Code tab. Write your Arduino sketch using the standard Arduino API.

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10); // wait for USB serial connection
}
Serial.println("Hello, Pico!");
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
note

USB Serial setup takes a moment. Use while (!Serial) in setup() to wait for the connection before printing, or messages may be lost.


Pin Layout

Pins GP0–GP28 are digital GPIO pins. GP26, GP27, and GP28 also support analog input.

Analog Input Pins

PinAnalog Channel
GP260
GP271
GP282

Power Pins

The simulator exposes the following power pins:

PinVoltage
VBUS5V
VSYS5V
3V33.3V
GND0V
ADC_VREF3.3V

Special Pin Functions

PinFunctionSignal
GP0UART0TX
GP1UART0RX
GP4I2C0SDA (Data)
GP5I2C0SCL (Clock)
GP16SPI0MISO (RX)
GP18SPI0SCK (Clock)
GP19SPI0MOSI (TX)
GP25On-board LEDLED_BUILTIN

On-Board LED

The Raspberry Pi Pico has an on-board LED on GPIO pin 25. Use LED_BUILTIN to control it:

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);

Simulation Features

FeatureStatusNotes
Processor (ARM Cortex-M0+)✔️Single core simulated
GPIO✔️GP0–GP28
UART✔️Used by Serial1
USB Serial✔️Used by Serial (USB CDC)
I2C🟡Master mode only
SPI🟡Master mode only
PWM✔️
ADC✔️3 channels (GP26, GP27, GP28)
Timers✔️
Watchdog✔️
PIO✔️Programmable I/O state machines
DMA🟡PIO peripheral only
RTC✔️

Legend:

  • ✔️ Supported
  • 🟡 Partial support
  • ❌ Not yet supported

Serial Monitor

The Pi Pico supports two serial interfaces:

  • Serial — communicates over USB (CDC). This is the default for the Serial Monitor.
  • Serial1 — communicates over UART0 (GP0 TX, GP1 RX).

USB Serial requires a brief setup time. Always wait for the connection in setup():

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}
Serial.println("Connected!");
}

Simulation Speed

The Raspberry Pi Pico runs at a 125 MHz clock frequency, matching real hardware.


Practical Limitations

  • Single core only — only one of the two ARM Cortex-M0+ cores is simulated
  • SPI and I2C are master mode only — slave mode is not supported
  • DMA is limited to PIO — DMA for other peripherals is not yet supported
  • Timing may differ slightly from real hardware — most Arduino code is unaffected