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.
- 9peripheral areas modeled
- 60projects ready to run
- Real timeon your own machine
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.
Open one and press Run
Each of these opens in the editor exactly as it is drawn here.
Every built-in project on the Pico
Each has its own page with the circuit running, the code and a parts list.
- Pico buttonBeginner
- Pico chaserBeginner
- Stop the light gameBeginner
- MicroPython knob dimmerBeginner
- MicroPython BME280 weather on an OLEDIntermediate
- CircuitPython blink on a PicoBeginner
- CircuitPython button on a PicoBeginner
- CircuitPython NeoPixel rainbow on a PicoBeginner
- CircuitPython BME280 on a PicoBeginner
- CircuitPython OLED text on a PicoBeginner
- DHT11 on a Pico with MicroPythonBeginner
- HC-SR04 on a Pico with MicroPythonBeginner
- Pico arcade buttonBeginner
- Leverless controller on a PicoAdvanced
- Fight stick on a PicoAdvanced
- Mixbox-style controller on a PicoAdvanced
- MicroPython blink on the Pico’s own LED, GP25Beginner
- MicroPython blink on a Pico, LED on GP15Beginner
- MicroPython button on GP13 lights an LED on GP15Beginner
- MicroPython table lamp on a Pico: a button toggles an LEDBeginner
- MicroPython flowing light on a Pico’s LED bar graphBeginner
- MicroPython breathing LED on a Pico, PWM on GP15Beginner
- MicroPython meteor light on a Pico’s LED bar, PWMIntermediate
- MicroPython on a Pico: import a module of your ownBeginner
- MicroPython random colors on a Pico’s RGB LEDBeginner
- MicroPython color wheel on a Pico’s RGB LEDBeginner
- MicroPython NeoPixels on a Pico: 8 LEDs on GP16Beginner
- MicroPython rainbow on a Pico’s 8 LED moduleBeginner
- MicroPython doorbell on a Pico: button and buzzerBeginner
- MicroPython alarm on a Pico: a siren on a passive buzzerIntermediate
- MicroPython serial print on a Pico: seconds since startBeginner
- MicroPython UART loopback on a Pico: GP8 to GP1Intermediate
- MicroPython on a Pico: read a potentiometer on GP26Beginner
- MicroPython dimmer on a Pico: a knob sets an LEDBeginner
- MicroPython color mixer on a Pico: three knobs, RGB LEDIntermediate
- MicroPython knob rainbow on a Pico: a pot turns 8 LEDsIntermediate
- MicroPython night lamp on a Pico: light sensor on GP26Beginner
- MicroPython thermometer on a Pico: thermistor on GP26Intermediate
- MicroPython joystick on a Pico: X, Y and the pressBeginner
- MicroPython 74HC595 flowing light on a PicoIntermediate
- MicroPython 7-segment digit on a Pico through a 74HC595Intermediate
- MicroPython four-digit display on a Pico, multiplexedAdvanced
- MicroPython relay and motor on a Pico: a button toggles itIntermediate
- MicroPython L293D motor on a Pico: a knob sets speedIntermediate
- MicroPython servo sweep on a Pico, signal on GP16Beginner
- MicroPython servo knob on a Pico: a pot points the servoBeginner
- MicroPython stepper motor on a Pico, GP21 to GP18Intermediate
- MicroPython I2C LCD1602 on a Pico, GP14 and GP15Beginner
- MicroPython HC-SR04 on a Pico, timed by handIntermediate
- MicroPython HC-SR04 on a Pico with a driver moduleIntermediate
- MicroPython 4x4 keypad on a Pico, GP13 to GP6Intermediate
- MicroPython keypad door lock on a Pico: servo and buzzerAdvanced
- MicroPython IR remote on a Pico: print each button’s codeIntermediate
- MicroPython IR remote dimmer on a Pico: keys 0 to 3Intermediate
- MicroPython DHT11 on a Pico: temperature and humidityBeginner
- MicroPython DHT11 and LCD1602 on a PicoIntermediate
- MicroPython motion sensor on a Pico: PIR on GP18, LEDBeginner
- MicroPython MPU6050 on a Pico: acceleration and rotationIntermediate
- MicroPython RFID on a Pico: read a card’s UID, RC522Advanced
- MicroPython RFID on a Pico: write a card and read it backAdvanced
Parts wired to the Pico, step by step
Each page has the wiring with the Pico’s own pin names, the code, the common mistakes and the circuit running.
- Raspberry Pi Pico DHT22
- Raspberry Pi Pico SSD1306 OLED
- Raspberry Pi Pico I2C LCD
- Raspberry Pi Pico Servo
- Raspberry Pi Pico HC-SR04
- Raspberry Pi Pico NeoPixel
- Raspberry Pi Pico Potentiometer
- Raspberry Pi Pico Buzzer
- Raspberry Pi Pico DS18B20
- Raspberry Pi Pico MPU6050
- Raspberry Pi Pico 28BYJ-48 Stepper
- Raspberry Pi Pico PIR Sensor
- Raspberry Pi Pico IR Receiver
- Raspberry Pi Pico RC522 RFID
- Raspberry Pi Pico Relay
- Raspberry Pi Pico Button
- Raspberry Pi Pico Keypad
- Raspberry Pi Pico BMP280
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.
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.
Tutorials that use this board
Each one ends in a running circuit, on this same board.
- The Raspberry Pi Pico pinout: PWM slices, ADC and power
- Read a button with the internal pull-up
- PWM on the Pico: slices, channels and 1 kHz
- Uno vs ESP32 vs Pico: which to start with
- MicroPython on the Pico: blink, a knob, a button and the REPL
- CircuitPython on the Pico: blink, a button, a BME280 and an OLED
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.
The other boards
Every one of these runs today, and every one is free.
Looking for the shorter introduction? See the Raspberry Pi Pico simulator page.
A RISC-V chip at 160 MHz, on the real memory map.
The classic Arduino, with an ATmega328P running at 16 MHz.
The Uno’s chip on a small board that fits a breadboard.
The big Arduino, with 54 digital pins and four serial ports.
An Uno-shaped board whose chip does its own USB serial.
A second RISC-V board, with 31 pins and simulated WiFi.
The classic ESP32 at 240 MHz, with simulated WiFi.
The ESP32-S3 at 240 MHz, with USB serial and an RGB LED.
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.