For my C335 Computer Structures course at IU, we developed a suite of "drivers" in C for the STM32VL-Discovery microcontroller in accordance with the course's lab manual.
Our final project was to create a simple game for the board using an Adafruit 1.8" LCD as the display, Wii nunchucks for player control, and the chip's onboard DAC capabilities to output audio.
The game's name, "The Little Haskells," was meant to be a tongue-in-cheek reference to The Little Rascals. The Little Haskells are a crack team of "rockstar programmers" who defend America through the power of buzzwords. The objective of the game is to pilot a ship through enemy networks and survive long enough to "reverse hack" into their systems.
Here is a demo video of the game running.
The following components are required to play the game:
- STM32VL-DISCOVERY - an ARM Cortex-M3 based microcontroller.
- Adafruit 1.8" LCD with Micro SD card reader - a basic lcd screen with a Micro SD card slot. The Adafruit model was selected because it came with some basic driver code that was translated to C.
- Wii Nunchuck Adapter - although our PCB was designed to have two nunchuck adapters built in, they are essentially the same as the "Nunchucky" adapters on Adafruit.
- Speaker and Potentiometer - we used a cheap speaker to provide audio and a potentiometer to modulate the volume. Since "The Little Haskells" only plays simple tones, I'm looking into using a piezoelectric buzzer instead.
Additionally, we used the FatFS file system to load and read files from the SD card.
- First download the STM standard libraries: STM32F10x_StdPeriph_Lib_V3.5.0
- Next download the CodeSourcery GNU toolchain Lite Edition
- Clone the STM32-Template repository.
- Modify the Tool path and Library path in
Makefile.common
to point to the CodeSourcery toolchain and STM32 standard peripheral libraries. - Edit the
Makefile
in the "thelittlehaskells" repository to point to your cloned STM32-Template. - Transfer the contents of the
Assets
folder to the root level of your micro SD card. - Properly wire your components (coming soon...)