HM55B and H48C 'C' code
Eric Shufro
Posts: 9
Attached is code for the HM55B·and H48C·that can easily be ported to other architectures.
Also attached is a spreadsheet·containing calibrated and non calibrated output data from·the HM55B.
The HM55B source code provided self calibrates (relative calibration, not necessarily relative to North).
At lease one full rotation of the HM55B must be made before the output data·is used.
Hopefully this will help others getting started with the HM55B and H48C on a non Parallax micro-controller.
--Eric Shufro
Courtesy of Micrium Inc.
www.micrium.com
Also attached is a spreadsheet·containing calibrated and non calibrated output data from·the HM55B.
The HM55B source code provided self calibrates (relative calibration, not necessarily relative to North).
At lease one full rotation of the HM55B must be made before the output data·is used.
Hopefully this will help others getting started with the HM55B and H48C on a non Parallax micro-controller.
--Eric Shufro
Courtesy of Micrium Inc.
www.micrium.com
Comments
1) A general purpose timer, and a way to determine its frequency in Hz.
2) 3 output pins.
3) 1 input pin.
To port the code, perform the following:
1) Under LOCAL MACROS· write the code to set the corresponding pins high and low. (Remove GPIOPinWrite() and replace it with something relevant for your target).
2) Within HM55B_Init(), write code to initialize the GPIO pins.· Set 3 pins to outputs, and 1 for input).· Initialize your free-running timer, and store its frequency in Hz within pclk_frq.
3) Adjust ShiftClkDly() to read the timer. Replace TimerValueGet() with equivalent code.
4) Assuming you have math libraries, the rest should compile. You may need to remove #include <includes.h> and include whatever header files your target requires.
--Eric
·
I need this code H48C but i am using LPC2148 ARM based microcontroller. Can you help me about this?
Thanks for you reply.
I wish I could be more help.
--Eric
·