BBC micro:bit V2 simulator, matrix and all
Mokxi models the micro:bit V2 on our own Cortex-M4 core, running the nRF52833 at 64 MHz. GPIO and GPIOTE, three TIMERs, RTC0, UARTE0, CLOCK, NVMC and FICR at their real addresses, the 5x5 LED matrix scanned the way the hardware scans it, and the two buttons and the speaker on the pads they really sit on.
- 7peripheral areas modeled
- 3projects 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-M4 (ARMv7-M) at 64 MHz, with SysTick and the NVIC and the three priority bits the nRF52 family implements
- GPIO
- Both ports, with the real OUT, DIR, IN and PIN_CNF registers, and the 13 k pull-ups and pull-downs the product specification gives
- GPIOTE
- Event and task channels plus the PORT event, so a pin change raises an interrupt rather than being polled
- TIMER0 to TIMER2 and RTC0
- Real prescalers, bit modes, shorts and compare channels; the RTC counts the 32.768 kHz LFCLK
- UARTE0
- EasyDMA and the legacy one-byte registers, paced at the configured baud rate, wired to the serial monitor
- The LED matrix
- Twenty-five LEDs on five row and five column pads, scanned a row at a time from the SysTick interrupt, exactly as the real board lights 25 LEDs from ten pins
- Buttons and the speaker
- A on P0.14 and B on P0.23 behind the board pull-ups; the speaker on P0.00, sounding while the edges keep coming
Not modeled
- The radio. There is no 2.4 GHz anything in the model, so no Bluetooth and no micro:bit to micro:bit messages.
- The sensors: the accelerometer, the compass and the microphone. The touch logo is not wired either.
- SAADC, PWM and PPI. analogRead and hardware PWM have no peripheral behind them yet; tone() is a square wave that the TIMER1 compare interrupt toggles.
- MakeCode and MicroPython .hex files. The firmware runtime here is ours, and it is Arduino-shaped.
Open one and press Run
Each of these opens in the editor exactly as it is drawn here.
Every built-in project on the BBC micro:bit V2
Each has its own page with the circuit running, the code and a parts list.
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 14 more, 22 in all: 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.
Which micro:bit?
The V2, on the nRF52833. The V1 is a different chip and is not modeled.
Does it run MakeCode or MicroPython?
No. Those ship as .hex images built against the vendor stack; the runtime here is ours and it is Arduino-shaped. Write the sketch in C++ and press Run.
Does it simulate the radio or the accelerometer?
No. There is no radio and no sensor in the model, and there is no pretense of one.
Why is the board beside the breadboard rather than in it?
A micro:bit has no header to push in. The five big rings sit along its bottom edge, and on a desk it is wired with crocodile clips, so here it stands over the board and reaches it with jumpers.
The other boards
Every one of these runs today, and every one is free.
Looking for the shorter introduction? See the micro:bit 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.