Board

Arduino Uno R4 Minima simulator, the RA4M1 running

The Uno R4 Minima is the Uno everyone buys now: the same board, the same 5 V pins, an Arm Cortex-M4 underneath. Mokxi models the Renesas RA4M1 at 48 MHz on our own core (the port block with its per-pin PFS registers, GPT PWM, SCI2 as Serial1, a fourteen-bit ADC) and says plainly where the model stops.

Start building free
  • 8peripheral areas modeled
  • 3projects ready to run
  • Real timeon your own machine
Arduino Uno R4 Minima: 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
Arm Cortex-M4 (ARMv7E-M) at 48 MHz, with the datasheet cycle count of every instruction. Soft float: the RA4M1 has an FPU and this core does not, so the runtime is built -mfloat-abi=soft and a VFP instruction faults rather than returning a wrong number.
Pins
One PmnPFS word per pin (direction, output latch, pull-up, open drain, analog switch), behind the PWPR write protection the real part has, plus PORTn’s PDR, PODR, PIDR and set/reset pair.
Time
SysTick at 1 kHz off the 48 MHz clock: reload 47,999, a whole number of cycles, so millis does not drift. micros comes from the same counter.
PWM
GPT channels on the six tilde pins (3, 5, 6, 9, 10 and 11) at 490.0 Hz, the rate an Uno’s phase-correct pins run at.
ADC14
A fourteen-bit conversion on A0 to A5 against the 5 V rail, timed at the converter’s own rate. analogRead returns ten bits by default, as the Arduino core does; analogReadResolution asks for the rest.
SCI2
Serial1 on D0 and D1, 8N1, paced at the configured baud rate, and the pin really idles high between frames.
USB
Serial, as a byte pipe with the register names on it: the socket goes straight to the chip, as on the real board.
Memory map
The real RA4M1 addresses: 256 KB of flash at zero with the option-setting word at 0x400, and 32 KB of SRAM. The link fails if you overrun either.

Not modeled

  • A USB stack. Serial is a byte pipe: no enumeration, no descriptors, no SETUP. `while (!Serial)` returns at once here and pauses for a moment on a desk.
  • The ICU’s event links, and so every peripheral interrupt: there is no attachInterrupt on this board, and a sketch polls. An ICU with invented event numbers would be worse than none.
  • The AGT, the clock generation circuit, the watchdogs, I2C, SPI, CAN, the DTC, the RTC, the DAC and the touch unit.
  • Vendor binaries: the Renesas FSP and the Arduino R4 core. The firmware runtime here is ours.
  • Some addresses are this model’s belief rather than a page of the user’s manual: the GPT and ADC14 blocks, the USB registers, and which GPT channel each PWM pin is. docs/uno-r4.md section 7 lists every one of them.
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 Uno R4

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 A4 (SDA) and A5 (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.

Which Uno R4 is this?

The Minima, the one with the USB-C socket and no WiFi. The Uno R4 WiFi has a page of its own: the same chip with an LED matrix and a simulated network.

How is it different from an Uno R3?

Same shape, same 5 V pins, same shield header. Underneath it is an Arm Cortex-M4 at 48 MHz rather than an 8-bit AVR at 16: more flash, more RAM, a fourteen-bit ADC, and Serial on the USB rather than on pins 0 and 1.

Why does analogRead give me 0 to 1023 when the ADC is fourteen bits?

Because that is what the Arduino core does, so a sketch written for an Uno reads the same numbers. Call analogReadResolution(14) and you get 0 to 16383; the register always held all fourteen.

Is Serial the same as Serial1?

No, and that is the R4. Serial is the USB socket and reaches no header pin. Serial1 is SCI2, a real UART on D0 and D1. Both show up in the monitor here; only Serial1 moves a pin.

Can I use attachInterrupt?

Not on this board. The RA4M1 routes a peripheral event to an interrupt through the ICU, and this model does not implement the ICU rather than guess at its event numbers. Poll the pin instead.

Will my firmware run on a real Uno R4?

The core, the pins, the port registers and SCI are the real ones. The GPT and ADC addresses, the USB registers and the PWM pin-to-channel map are marked unverified in docs/uno-r4.md section 7. Check that list first, and it is a short one.

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.