Compass module help

Status
Not open for further replies.

AGCB

Member
I've been trying to write assembly code for a parallax 29133/Honeywell HMC 5883 L compass module. I've been
unable to find any examples in assembly and my ability to understand Stamp BS2 is poor.

In the Honeywell data sheet, there is a statement I don't understand.
I'm hoping someone can help me understand the instructions in the "operational example"
on page 18 of the HMC5883L datasheet.

www51.honeywell.com/.../HMC5883L_3-Axis_Digital_Compass_IC.pdf

For the continuos-measurement mode, line 5. it says
...5. Loop
Send 0x3D 0x06 (Read all 6 bytes. If gain is changed then this data set is using previous
gain)
Convert three 16-bit 2’s compliment hex values to decimal values and assign
to X, Z, Y, respectively.
Send 0x3C 0x03 (point to first data register 03)
Wait about 67 ms (if 15 Hz rate) or monitor status register or DRDY hardware
interrupt pin
End_loop
To me it seems like we would point to the first data register before reading.
Secondly register 0x06 is the Data Output Z LSB Register (the 4th output register) this
could be a typo.
However, I've tried it multiple ways and in different orders and still get no or bogus info.
The problem may be in my I2C code as I've not read multiple registers before. But I'd
like to get this question answered 1st.
Thanks
Aaron
 
I glean a little from even c code but it's not much.

I ask again what does 0x3d 0x06 mean? Can you specify anything after calling a read? And why 0x06 and not 0x03, which is the first data register.
Aaron
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…