OKAY

Microcontrollers are pretty cool; let’s build a game console.

okay

Video demo at the bottom.

Make Up Some Requirements

The requirements call for a menu where the user can select a game to play. When a game is exited, the user returns to the menu.

Furthermore, there needs to be a way to plug the console into a computer and load in new games.

Find Parts

The components we’ll use:

  • 8 bit AVR ATmega168V (1KB RAM; 16KB Flash)
  • Nokia 3310 LCD (black and white 84x48) with backlight panel
  • Buttons for D-pad, A/B, and start/select inputs
  • 32KB EEPROM chip for game storage
  • Li-poly battery (with external charger board)
  • Piezo buzzer speaker

    components

The Design

To maximize RAM and flash available to games, and to increase performance, we can have two microcontrollers work together:

  1. The User AVR: Fully dedicated to the user’s running application (minus flash space for a bootloader)
  2. The OS AVR: Contains drivers, the game selection UI, and external interface for loading games

The ATmega168V can only execute code from flash. Therefore a bootloader on the User AVR reflashes the device every time an application is loaded. The ~10K limit on flash erase/write cycles works well enough for a project like this.

The two AVRs communicate over an SPI bus. While the application runs on the User AVR, the OS AVR processes RPC style requests to render graphics and play audio sequences.

  1. Console boots and the OS AVR runs the (TI-calc inspired) menu UI, showing games loaded from a basic filesystem on the EEPROM chip.

    UI

  2. Game selected. The OS AVR sends the game image to the User AVR to be flashed.

    loading

    cpus

  3. The User AVR starts executing the game.

    tennis

  4. While running, the User AVR does RPC to display graphics (text, sprites, lines) and play audio (tone sequences).

    graphics

  5. Upon game termination, the User AVR informs the OS AVR it should take over.

Construction

Prototype board during development

dev board

Compact final design

final design

Write Games, Play Games

8 bit microcontrollers can go a long way :)