Board

Raspberry Pi Pico simulator, RP2040 and all

Mokxi models the Raspberry Pi Pico on our own Cortex-M0+ core, running the RP2040 at 125 MHz. SIO GPIO, a microsecond timer with four alarms, both UARTs and eight PWM slices use their real addresses. Test finished firmware on the physical board too.

Start building free
  • 9peripheral areas modeled
  • 60projects ready to run
  • Real timeon your own machine
Raspberry Pi Pico: blinklive0.000 s 0.00x
Click to open it in the editor
The board is running real firmware right now. Click it to open the circuit in the editor.
The model

What is modeled

Taken from the board's own contract document and put in plain words, with what is missing beside it.

Modeled

Core
Cortex-M0+ (ARMv6-M), one core, with the datasheet cycle count of every instruction
SIO GPIO
Real register offsets on IO_BANK0, PADS_BANK0 and SIO, with pull-ups as the datasheet gives them
TIMER
A 64-bit microsecond counter with four alarms, which park the core during delay() rather than spinning on it
UART0
Paced at the configured baud rate, wired to the serial monitor
UART1
Serial2 on GP4 and GP5, or another UART1 pair from setTX() and setRX(): real frames on the wire, bit by bit, for a GPS module or a second board
ADC
Twelve bits on GP26 to GP28 against 3.3 V, and the temperature sensor, so potentiometers and light sensors read
PWM slices
Eight slices, two channels each, so analogWrite works on every GPIO pin
Sleep
WFI parks the core between events, so an idle sketch costs almost nothing to simulate
Memory map
The real RP2040 addresses for everything above, so a build is not Mokxi-specific

Not modeled

  • The second core. SIO.CPUID reads 0, and there is no way to launch core 1.
  • PIO, and for an Arduino sketch DMA and the I2C and SPI blocks (Wire and SPI run in software on ordinary pins). A MicroPython program has DMA, I2C and SPI: machine.I2C and machine.SPI drive the RP2040’s own blocks.
  • The ADC’s FIFO, DMA and interrupt. analogRead and analogReadTemp work, one sample at a time.
  • USB, including running Raspberry Pi Pico SDK binaries: those need the bootloader and clock tree, which are not modeled.
Start here

Open one and press Run

Each of these opens in the editor exactly as it is drawn here.

Projects

Every built-in project on the Pico

Each has its own page with the circuit running, the code and a parts list.

Libraries

Arduino libraries that compile as they are

Paste a tutorial that includes one of these and it builds. For any other library, the build names the Mokxi header that does the same job.

Servo.h
attach, write, writeMicroseconds, read, detach, on any pin
Wire.h
I2C as a master; Wire.begin() puts it on GP4 (SDA) and GP5 (SCL)
SPI.h
transfer and transactions, on the board’s usual SPI pins
EEPROM.h
read, write, update, get, put and EEPROM[i], kept in 4 KB of RAM, which a reset clears: this board has no EEPROM to write
LiquidCrystal_I2C.h
the 16x2 LCD behind its I2C backpack
Adafruit_GFX.h and Adafruit_SSD1306.h
the 128x64 I2C OLED: text, pixels, lines, rectangles, circles, triangles and bitmaps
Adafruit_NeoPixel.h
WS2812 strips and panels
DHT.h
the DHT11 and DHT22: temperature, humidity and the heat index, as floats you can print

And 15 more, 23 in all: OneWire.h and DallasTemperature.h; Adafruit_BME280.h, Adafruit_BMP280.h and SparkFunBME280.h; RTClib.h; Adafruit_SHT31.h; Adafruit_PCF8591.h; Adafruit_ADXL345_U.h; LedControl.h; Adafruit_LEDBackpack.h; Adafruit_TCS34725.h; Adafruit_SGP30.h; Adafruit_INA219.h; Adafruit_ADS1X15.h; Adafruit_MCP23X17.h; Bounce2.h; HX711.h.

Questions

Is it free?

Yes. Every board and every part is on the free plan, with no account needed.

Does it run Pico SDK binaries?

No. The SDK needs the second-stage bootloader and the clock tree, and neither is modeled. The firmware runtime here is ours, and it is Arduino-shaped.

Will my firmware run on a real Pico?

Yes, as long as it does not reach for the second core, PIO, DMA or the ADC. The memory map and the register offsets are the real ones.

Do I need an account?

Only to save projects to the cloud and share them by link.

Try it on your own firmware

What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.