I’m starting to get accustomed to using an ARM chip and wanted to do a small project. I’ve always enjoyed playing the game of Snake, but never programmed it myself. I present to you Snake on an ARM Cortex-M0 microcontroller.
I’m using the STM32 F0 Discovery board along with a Nokia 3595 cellphone screen. The hardware SPI on the ARM chip makes it pretty easy to address the display. But I’ve written the program to be display agnostic. Keep reading for more details on the programming choices I made.
I’ve been trying off and on for years to get into ARM development. But my insistence on using FOSS for development has proven a difficult hurdle to overcome. But recently I acquire an STM32F0-Discovery board when they were offering samples. I’m proud to say I managed to get to a point where prototyping for the hardware on a Linux box is easy. I’ve written a bit about it here, and have posted a basic template (including Makefiles) in a github repository.
Above you can see my first working project. I ported it over from an AVR project, it’s the discovery board driving a Nokia 3595 LCD screen. It’s nice to have a microcontroller which is already at the 3V levels this display expects. Right now I’m addressing it via software, but I plan to migrate to hardware SPI and look into generating video. We’ll see.
One of my other near-term plans is to put up a quick post about how to use my template to compile the STM example code. I found that the image shipping on the boards is just a bit different from the source they provided in the firmware package.