Skip to content

Game Programming On Microcontrollers

Since it’s been a while since I wrote about anything I decided to post something to fill the gap till my next XNA post.

Most computer games today are executed on relatively powerful microprocessors running on personal computers, stationary game consoles or handheld devices and mobile phones. However, there were obviously times when hardware was not as advanced when programmers had to cope with less powerful processors and less memory.

In the technical computer science lab at my university me and two friends were programming an ultra-low power microcontroller (Texas Instruments MSP430) with only 2 KB of RAM. The processor can be set to run at only a few Khz and up to 11 Mhz.

Just for fun we decided to try programming a little game on this device. Lacking any video memory or dedicated graphics circuits we could of course not use an actual video display. Instead we used a simple oscillograph to display up to 300 hundred points on its screen. The number was mainly limited by the small amount of RAM. However, executing too many floating point operations also resulted in significant performance problems. Therefore we tried to avoid floats where possible.  The output of the oscillograph was controlled by two seperate voltage sensitive inputs, one for the X and on for the Y axis of the screen.

The result can be seen in the following video. We implemented a simple version of “Tanks”, where two players try to shoot each other over a randomly generated landscape using ballistic projectiles. For aiming we used the integrated accelerometer which enables controlling the shooting angle by tilting the device.


The “game” was written in C using the standard API of the device which is very low-level. Most operations we performed by writing distinct byte patterns into certain registers. The program itself was distributed over 3 devices. One controller (the “station”) calculated the game itself and send the output to the oscillograph while two further devices were used as game controllers, which send the player commands (aiming per accelerometer and shooting per button press) to the “station” via radio using a GPRS module.

It was fun to work with such a “weak” device and at such a low level for once, since it really grants you a totally different view on game programming. Not only do you have to focus on performance more than usual, but also you learn to limit the game to the bare essentials which are needed to make it work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: