Go Down

Topic: Looking for help with HMC5883L compass from other users (Read 12 times) previous topic - next topic

Mjolinor

Well it seems that if I bonk the chip with the screwdriver it stops doing it, this is both chips. I reckon I'll wait until I get more chips.


Subpilot

I have had no luck getting valid readings on several different boards. I ordered the Seeed Studio board which has a chip with the M883 ID and it works fine. I am going to try replacing the chip and attempt to use the least amount of heat possible to see what happens.

wayneft

Oops forgot to update my results.  I switched to solely mounting the chips using Hot Air Rework and have had zero problems since.  I've assembled close to 20 boards and everything checks out. I have a little matrix I put together for checking the board with a continuity meter that seems to show whether or not the board is working before powering it up.  If anyone is interested I can post it later when I get home.

@Subpilot, keep in mind the Seeed Studio board is based off the HMC5883 not the HMC5883L, they're different chips and not pin compatible.

I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

Subpilot

OK, I'm an idiot. I have a magnet in my interface assembly. It's used for a reed switch that switches to external power when the interface is connected. Moved the magnet and low and behold it's all good. :smiley-red:

Mjolinor


OK, I'm an idiot. I have a magnet in my interface assembly. It's used for a reed switch that switches to external power when the interface is connected. Moved the magnet and low and behold it's all good. :smiley-red:


This is such good news, makes me feel normal. I am the one who took the NACK out of the last read because there wasn't a last read when the buffer was circular and forgot to put it back in when they informed me that the buffer wasn't circular. That too sorted a lot of the problems.

It's just a damn good job we aren't running countries or something similar. :)

robtillaart

Quote
It's just a damn good job we aren't running countries or something similar.

Maybe it is a pity...

You guys accept you made a mistake and learn from it. There are people running countries (etc) that would not do it so easily ..
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Fabio Varesano

Instead of creating your own, wouldn't have been better to improve what's already available ?

https://launchpad.net/hmc58x3

realtime

To give us all a bit more clarity, I would like to reassure some facts:

hmc5883L = L883, 7bit-address = 1E
hmc5883 = M883, 7bit-address = 1E

Ther is no address difference in these two differnet chips (?!).

However, my Experience is also twofolded. My L883 responds fine at the given address, but when I read the Registers, they behave odd.

On an arduino they work fine, but when I use them with a FEZ, the MSB of the registers X,Z,Y are either 0 or 255. This depends in what direction I turn the device. LSB is fine for both devices. I believe that I configure both the same way. Continious mode and Gain 1.3.

I mean would the MSB of the axis max / min out if gain is wrong?

The only difference between these mcu is the voltage on the I2C. Is that the reason?

GT

zhivkec

I understand you exactly when you say two folded - I also had same experience - but luckily solved with help of that forum.
I originaly interfaced HMC5883L with plain C from beaglebone embbeded linux platform.
I was getting strange values if I turned device for around 90 degrees - values were like 65231, etc, but originaly when device was on desk they were like normall (around 0 to 10) - I am talking about raw data obtained by:

Code: [Select]

  x=outputData[0] << 8 | outputData[1]; //Combine MSB and LSB of X Data output register
  z=outputData[2] << 8 | outputData[3]; //Combine MSB and LSB of Z Data output register
  y=outputData[4] << 8 | outputData[5]; //Combine MSB and LSB of Y Data output register


I resolved issue properly declaring x, y and z variables with:

Code: [Select]

     short x,y,z=0;


instead of:

Code: [Select]

     int x,y,z=0;


maybe that's also true for rest of you that you have similar problems.

I am attaching working code in plain C.


sbright33

#40
Apr 17, 2012, 07:03 pm Last Edit: Apr 17, 2012, 07:07 pm by sbright33 Reason: 1
I had difficulties with this chip too.  I found my heading was off by sometimes 90 degrees, other times about correct, but always the same error depending on your heading.  I'm not using tilt compensation, yet.  See my thread here.  To fix this I rotated the unit 90 degrees about the Y-axis.  Now I'm using X and Z instead of X,Y to get the heading, much better.  Don't pay attention to those specifics.  If you're having a problem like mine, try using 2 different axis instead.  Change the code by 1 char, and rotate it 90 deg.  It's that simple.  Not sure what you'd do if you wanted to see all 3.  Will let you know.

I found an easy way to do (limited) tilt compensation, without ANY additional math.
See other thread.

http://arduino.cc/forum/index.php/topic,100672.0.html
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Go Up