UC Fun Kit (UCFK4) – Two-Player Embedded Game
ENCE260 Computer Systems · Team of 2 · AVR / Embedded C
Summary
Developed a two-player interactive embedded game on the University of Canterbury Fun Kit (UCFK4) platform as part of ENCE260. The project required low-level C programming on an AVR microcontroller, real-time input handling, IR-based inter-board communication, and display control. Two boards synchronise gameplay over infrared, using navswitch and pushbutton inputs with real-time feedback on the onboard LED matrix. The project emphasised deterministic state machines, hardware abstraction, and modular firmware design under tight timing constraints.
Platform
The UCFK4 is an AVR-based development kit used in ENCE260 to introduce embedded C programming, memory-mapped I/O, interrupts and timers, finite state machines, and real-time task structuring. Board peripherals include a 5-way navswitch, pushbutton, LED matrix display, status LEDs, and an IR communication module. All firmware was written in C using direct hardware control and register-level interaction.
System Architecture
The firmware is modularised into separate concerns: game.c (core game logic and state machine), message.c (IR communication protocol), player_setup.c (initialisation and player pairing), display_bitmap.c (display control), and win_lose_screen.c (end-state rendering). This separation ensured maintainability and clean abstraction between hardware control and game logic.
State machine: A deterministic FSM handles Setup → Player Synchronisation → Active Gameplay → Message Transmission → Win/Loss state. Non-blocking logic was critical to keep IR communication responsive during gameplay.
IR communication: A lightweight IR messaging layer handles two-player pairing, game state updates, action confirmation, and outcome detection. Careful timing and polling prevent dropped packets while maintaining display refresh rates.
Display control: Custom bitmap rendering draws game elements, updates frame states, indicates player actions, and shows end screens. Optimised refresh handling ensures flicker-free updates while concurrently processing inputs and IR communication.
My Contribution
Core game state machine design, IR messaging structure and packet handling, display logic integration, input handling architecture, debugging timing and synchronisation issues, and code modularisation and integration testing.
Artifacts
Key Skills & Tools
Firmware & Hardware
- Embedded C on AVR microcontroller
- Register-level hardware control
- IR communication protocol implementation
- LED matrix display rendering
- Navswitch and pushbutton input handling
Software Architecture
- Finite State Machines (FSM)
- Non-blocking firmware design
- Modular C file structure
- Real-time task timing discipline
- Hardware abstraction layers
Tools & Process
- Makefile-based build system
- Two-board inter-device synchronisation
- Timing and state debugging
- Team firmware integration (team of 2)