Mini PacMan

Project One hero image

Goal

As a fun project idea, me and my partner decided on the task of creating a working game of PacMan on a STM32 MCU. Our goal was to configure everything by hand, cramming as much functionality as we could within our limited time frame.

Hardware

  • STM32L476RG Microcontroller
  • Mini OLED Display- Any Ordinary 128x64 display
  • Small breadboard compatible speaker
  • Dual-Axis Joystick
  • Peripherals

  • GPIOB - Drives the OLED
  • GPIOA - Takes both the Buzzer and Joystick
  • Systick - Scans and updates the system
  • ADC - Filter Joycon Input
  • DMA - Takes the filtered ADC channels into a buffer
  • Firmware

    The most important task was to using STM32Cube IDE to configure the correct MCU bits. And the backbone of the entire code is spent manipulating and referencing a
    128 x 64 matrix. A lot of thought was put into the logic of how PacMan would move and update the display, but the general design could be summed into:

    Initialization and play music ⇒ Get direction from joystick ⇒ Update the matrix/filter the Direction ⇒ Display Changes (if any) ⇒ loop back to joystick


    Demo

    Here is the finished demo of the PacMan project.

    Inspiration & Credit

    ← Back to all projects