View Single Post
  #1   Spotlight this post!  
Unread 29-06-2008, 07:41
westaust55 westaust55 is offline
Registered User
no team
 
Join Date: Jun 2008
Location: Perth WA
Posts: 2
westaust55 is an unknown quantity at this point
Question 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.

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.