Donkey Kong Handheld

MSPM0+ · bare-metal C · custom PCB · ST7735 TFT · ADC / DAC · interrupt-driven FSMs
January – April 2026 · ECE 319K final project with Pranav Shivashankar · source on GitHub

// gameplay running on the assembled custom PCB

The story

UT Austin's ECE 319K (UT's intro embedded systems course) builds toward one thing: building a handheld video game from scratch. Most teams do the standard Space Invaders. My partner Pranav and I wanted a game we both loved from childhood, so we built Donkey Kong, reimagined as a fast-pace high-score challenge.

I recreated the five-level game board and implemented the gameplay from the ground up: randomized barrel paths, Mario movement using an ADC-controlled slide potentiometer, pushbuttons for jumping, climbing, and pausing, interrupt-driven sound effects, animated menus, and full Spanish-language support.

To go beyond the course requirements, we designed and assembled a custom PCB, transforming the project from a breadboard prototype into a fully handheld game.

What it does

System Architecture

Three interrupt timers drive the game independently of the render loop:

TimerRateResponsibility
TIMG1230 Hzgame engine tick — animation frames, score, banana timer, barrel spawning
TIMG030 Hzbarrel path stepping
SysTick11 kHzDAC sound output — sample-by-sample audio
System block diagram: inputs through ADC/GPIO, timers, game engine, SPI display, DAC audio

// system block diagram (course-provided architecture): every peripheral, pin, and routine

The key discipline: ISRs only mutate state, all SPI display output happens in main. That keeps slow SPI traffic out of interrupt context, so the game logic never stutters. Rendering is dirty-rect based: the hero is erased and redrawn only when his coordinates change, and barrels repaint only when the path ISR raises a flag. Over a slow SPI display, that discipline is the difference between smooth and slideshow.

When the game is paused, both gameplay ISRs immediately return, making pause effectively free from a CPU perspective.

From breadboard to board

The project began on a breadboard using a LaunchPad before being migrated to a custom PCB featuring an MSPM0G3507, ST7735 TFT, pushbuttons, slide potentiometer, and binary-weighted DAC for audio output.

// early board creation on the breadboard prototype: LaunchPad, jumpers, and all

Final custom PCB with UT crest silkscreen

// the final board, populated: buttons, slide pot, audio jack, LEDs: UT crest on the silkscreen