The overview, with examples running, is on the board page and The BBC micro:bit V2 model (every register).

The BBC micro:bit V2

An nRF52833 on our Cortex-M4 core: GPIO, GPIOTE, three TIMERs, RTC0, UARTE0 and the 5x5 LED matrix.

What it is

The BBC micro:bit V2, an nRF52833 running on our own Cortex-M core in its ARMv7-M profile at 64 MHz. Firmware is a Thumb ELF talking to the real nRF52833 addresses, so the same image runs on real hardware.

The V1 is a different chip, an nRF51822, and it is not modeled.

The pins

A micro:bit has no header. Its edge connector is a gold comb along the bottom of the board, and only the five big rings take a crocodile clip or a jumper, so the board stands beside a breadboard rather than in it.

Those five rings are the pins: 0, 1, 2, 3V and GND, left to right with the USB socket at the top. 0, 1 and 2 are GPIO on P0.02, P0.03 and P0.04, with the chip's own 13 k pull-ups and pull-downs when you ask for them.

This is a 3.3 volt board. 3V supplies 3.3 V and GND is the return, both at rail impedance, because the board is powered over USB.

The small strips between the rings are real GPIO on the chip and a sketch can drive them, but they are not wireable here: nothing on a breadboard reaches a strip 0.06 inch wide.

What is on the board

Twenty-five LEDs in a 5 by 5 grid, on five row pads and five column pads. There is no single LED to blink: the firmware scans the grid a row at a time from the SysTick interrupt, and the simulator reconstructs the picture your eye would see from that scan.

Buttons A and B are on the board itself, either side of the display. Click them on the canvas, or press A and B on the keyboard while the circuit is running. The speaker is on P0.00, and it sounds while the pad is toggled at an audible rate.

What is modeled

GPIO on both ports, GPIOTE with its event, task and PORT channels, TIMER0 to TIMER2, RTC0 on the 32.768 kHz clock, UARTE0 with both EasyDMA and the legacy one-byte registers, CLOCK, NVMC and FICR.

That is the set pinMode, digitalWrite, digitalRead, millis, micros, delay, Serial, attachInterrupt, showLeds, showText and tone need, at their real addresses.

What is not

The radio, so no Bluetooth and no micro:bit to micro:bit messages. The sensors: the accelerometer, the compass, the microphone and the touch logo. SAADC, PWM and PPI, so analogRead and hardware PWM have nothing behind them; tone is a square wave that TIMER1's compare interrupt toggles, so the sketch carries on while the speaker plays.

Those address blocks are unmapped, so touching one is a bus fault rather than a silent zero. That is deliberate: a program that quietly reads nothing is harder to debug than one that stops.

MakeCode and MicroPython are also out of scope. Both ship as .hex images built against the vendor stack, which expects the soft device and a file system. Write the sketch in C++ and press Run instead.

Two approximations are worth knowing. The LED matrix on the canvas is all twenty-five pixels at once: the row-by-row scan is real in the register writes, and a test checks that one row is lit at a time, but the picture the canvas gets has no per-pixel brightness and no persistence. And the clock tree is a stub: HFCLKSTART completes instantly and the core runs at 64 MHz whatever is asked for, so there is no crystal start-up and no low-power domain.

The full list, and section 8's sorting of what is a specification number and what is an approximation, is in the BBC micro:bit V2 model.

Stock Arduino libraries

A tutorial that includes Servo.h, Wire.h, SPI.h, EEPROM.h, LiquidCrystal_I2C.h, Adafruit_GFX.h with Adafruit_SSD1306.h and DHT.h compiles here as it stands. Each is Mokxi's own header under the upstream name, written on the drivers for the parts in the bin, and none of it is the upstream library's code.

  • Wire.begin() puts the I2C bus on edge pins 20 (SDA) and 19 (SCL).
  • EEPROM.h works, but this board's model has no EEPROM or writable flash, so the bytes live in 4 KB of RAM: they read back within a Run and are gone at a reset.
  • Adafruit_NeoPixel.h stops with a message: a WS2812 bit is too short to make by hand on this board, and only the ESP32-C3 and ESP32-C6 drive the strip.

The code editor and compiling lists what each one covers and how it differs from the upstream library.

The examples

Blink, Button, Serial and Scroll.

Elsewhere