Embedded Systems

BOP-IT

Written in C++ against an AVR's registers and interrupts — doing a lot with very little memory.

Year2024
StackC++ · AVR/ATmega · Arduino
View source
BOP-IT

BOP-IT is the classic call-and-react toy rebuilt on bare metal — no framework, no operating system, just C talking straight to an AVR microcontroller’s timers, ports, and interrupt vectors.

The constraint

Working this close to the chip is the whole point. There is no allocator to lean on and no scheduler to hide behind; every byte of RAM and every clock cycle is something you account for yourself. The game has to fit in a few kilobytes and still feel instant.

How it works

A hardware timer drives the round clock while an interrupt-driven input loop samples the controls — so the chip never sits in a busy-wait. As rounds speed up the timing budget shrinks, and an interrupt-first design is what keeps inputs responsive when there is no slack left.

  • Interrupt-driven input — no blocking polls.
  • Hardware timers for precise, accelerating round windows.
  • Entire game state kept in a few kilobytes of RAM.

What I learned

Constraints are clarifying. With nothing to abstract the hardware away, you understand exactly what the machine is doing on every cycle — and that understanding is worth more than any framework I could have reached for instead.