Pages: 1 2 [3]   Go Down
Author Topic: Looking for help with HMC5883L compass from other users  (Read 9881 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Worcester, MA
Offline Offline
God Member
*****
Karma: 2
Posts: 623
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ..
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you guys are still struggling with this chip there is a tutorial on the HMC5883L here: https://www.loveelectronics.co.uk/Tutorials/8/hmc5883l-tutorial-and-arduino-library
Logged

Torino, Italy
Offline Offline
Sr. Member
****
Karma: 2
Posts: 312
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

https://launchpad.net/hmc58x3
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Grosuplje
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
  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:
     short x,y,z=0;

instead of:

Code:
     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.


* chuk_trainer.c (4.34 KB - downloaded 21 times.)
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 17, 2012, 12:07:00 pm by sbright33 » Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: 1 2 [3]   Go Up
Jump to: