Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Calibrating CMPS03 compass module (http://www.chiefdelphi.com/forums/showthread.php?t=68264)

westaust55 29-06-2008 07:41

Calibrating CMPS03 compass module
 
Hi all,

I have a Devantech CMPS03 compass module.
Initially was accurate without calibration but then lost calibration without any known reason.

I can read data (firmware revison, heading in 1-byte and 2-byte mode) without problems. I am using a Rev.Ed. PICAXE 40X1 PIC based microcontroller.

To calibrate one must write the value 255 ($FF) to register 4 times.
Each time it is cleared and then you move to next cardinal point and write 255 again into register.
Pin 5 is normally high but goes low during the calibration period until all 4 cardinal points have been logged by the calibration then pin 5 returns high.

If I modify my calibration program and read register 15 initially it is 0. Then when I write the value 255 to register 15, if I read back I see 255 but it is never cleared and pin 5 never goes low. :mad:

I have finally tried calibration by the manual method with a switch on pin 6 and that has worked. :)

So my question is:
has anyone here managed to calibrate a CMPS03 using software and the i2c bus?

If so would appreciate a copy of your i2c based calibration code.


All times are GMT -5. The time now is 00:05.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi