DOOM on a $30 FNIRSI Clamp Meter: 32 KB of RAM, No Framebuffer and a Steady 29 fps

User Avatar Aswinth Raj
Author
Share
DOOM Running On A 30 Clamp Meter

Running DOOM on odd hardware is an old tradition, but Artur Bieniek has picked one of the tightest targets yet: the FNIRSI DMC-100, a budget clamp meter built around an Artery AT32F415 microcontroller with just 32 KB of RAM. His open-source port of doomgeneric plays the whole first episode of Freedoom on the meter's 320x240 colour screen, with sound effects on the buzzer, and it averages 29 frames per second in the standard DEMO1 benchmark. That is not a framebuffer squeezed into RAM. At 320x240 a single 8-bit frame would need about 75 KB, more than twice the RAM the chip has.

How DOOM fits into 32 KB

The trick is in how the port treats memory. According to the repository, the program itself gets 99 KB (101,376 bytes) of the microcontroller's internal flash. Everything else lives on the meter's 4 MB SPI NOR flash, which cannot execute code in place. So the port streams map data from the NOR chip as it needs it, loads parts of the program into RAM as overlays when they are called, and draws the screen with a strip renderer instead of holding a whole frame in memory. To keep the work down it renders in low detail (160 columns, each drawn twice), and it drops the automap and the Nightmare skill level.

The game logic is left alone. Artur's host test suite checks that Freedoom's DEMO1 and scripted runs through every map of episode 1 play tic for tic the same as unmodified doomgeneric, and the build also has tests that run in the Renode emulator. You get E1M1 to E1M9 with the title screen, intermissions, finale, menu and four save slots. If you connect a DJI RC-N1 drone controller, it works as an analog gamepad.

Key details

  • Meter: FNIRSI DMC-100 clamp meter, Artery AT32F415 MCU, 32 KB RAM, 320x240 display
  • Storage: 99 KB of internal flash for the program, game data on a 4 MB SPI NOR flash exposed as two USB drives (1 MB firmware, 3 MB data)
  • Game data: Freedoom: Phase 1 episode 1 by default. Owners of DOOM can build with episode 1 of their own IWAD
  • Speed: 29 fps on average in shareware DEMO1 (E1M5); the heaviest case measured, Freedoom DEMO1 (E1M6), ran at 24 fps with the NOR flash at 72 MHz
  • Toolchain: clang and ld.lld 20 or newer. With clang 19 the image does not fit in flash
  • Licence: GPL-2.0

Our take

The most useful engineering detail here is not the game but the honest notes on the flash. At 72 MHz, Artur found that 2 of the 4 KB blocks in 1 GB read back wrong, so the default build reads the NOR at 36 MHz, where he saw no errors. A single bad byte stops the game with a data error instead of crashing silently. Any engineer who has pushed an SPI flash past its comfortable clock on a real PCB will recognise that trade-off.

The same engine is already spreading. Aaron Christophel has used it to run DOOM natively on the PY32F403-based Aspire PIXO vape and its small LCD, with episode 1 complete at about 19.8 fps, and his write-up credits Artur's strip renderer and flash-streamed map data. For anyone working on small MCUs with a big external flash and little RAM, the repository is a practical lesson in overlays, streaming and memory budgets.

A word of caution if you want to try it. Flashing DOOM replaces FNIRSI's firmware and may void the warranty, and while DOOM is installed the meter measures nothing, so don't connect the test leads. The repository includes a restore script to flash the original firmware back. The code, build steps and benchmarks are on GitHub.

Image credit: Artur Bieniek, frame from his YouTube video, cropped and resized.

About the author: Aswinth Raj is an electronics engineer and the editor of CircuitDigest, where he has published more than 150 hands-on projects and tutorials across Arduino, PIC, ESP32, Raspberry Pi and EV battery systems. He selects the stories on this page for what engineers and makers can actually learn or build from. Connect on LinkedIn

Add a comment

No account needed. Your comment appears once a moderator has reviewed it.

Never shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.