Testing the HM55b Compass module with an AT90S2313 AVR

HM55B test board

Introduction

I received a Parallax HM55B compass module and wanted to quicky test it out, so I interfaced it with an old AVR and wrote a program to read the X and Y values and send them to a PC over the serial port.

Design

HM55B test
HM55B test

HM55B test board
HM55B test board

HM55B test app
HM55B test app

HM55B test video

The compass module is wired to PORTB of the AVR, and a USB<->Serial connects to the UART.

The software on the AVR is written in assembly. It is programed to wait for a any byte to be recived on the UART, then reads the X and Y values from the HM55B, and transmits them over the UART as 4 bytes – 2 x 16bit signed integers (Y-LSB, Y-MSB, X-LSB, X-MSB).

A simple app is written in C# (2008 Express Edition), which requests X&Y, then converts these values into an angle in degrees.

Files

AVR Studio HM55B test

Visual Studio 2008 HM55B test