Embedded Systems

BOP-IT

Register-level C++ across two ATmega328P boards — an IMU, an SPI display, and a Bluetooth link — doing a lot with very little memory.

Year2024
StackC++ · AVR/ATmega328P · PlatformIO · I2C · SPI · UART
View source
BOP-IT

BOP-IT is the classic call-and-react toy rebuilt on bare metal: two ATmega328P boards, register-level C++, and no Arduino framework hiding the hardware. A handheld controller calls the actions; a separate display unit keeps score over a wireless link.

Bare metal, by hand

Instead of the Arduino abstractions, the game runs on custom register-level libraries — SPI, USART, timers, I2C — so every port, timer, and interrupt vector is set directly. The whole thing lives in a few kilobytes of RAM, and you account for each one yourself.

Reading the player

A BNO055 IMU over I2C reads tilt from Euler angles; a tilt-ball switch catches shakes; potentiometers handle twist and volume; buttons cover the rest. Input is interrupt- and timer-driven, so the chip never sits in a busy-wait — which matters as rounds accelerate and the timing budget shrinks.

Two units, one game

The controller and the ST7735 display (128×160, SPI) are separate boards talking over Bluetooth (USART). Splitting input from display meant solving wireless timing and protocol reliability between two microcontrollers — the unglamorous half of the project.

Details that make it feel alive

Six LEDs track the round timer and three lives; a passive buzzer plays the Cantina Band theme at 140 BPM while the pace ramps up.

What stuck

Constraints are clarifying. With custom libraries down to the registers, you know exactly what the machine does on every cycle — and that understanding is worth more than any framework I could have reached for instead.