HMC6352 Compass behaving oddly
stargazer2050
Posts: 89
hmc6352 Compass
compass is a parallax product purchased from sparkfun and resides on a little red board with 3 10k resistors on it
Quickstart propeller bd
win xp
1. this compass and an identical one that i readdressed to 0x40 work simultaneously and flawlessly on an arduino uno.
2. This compass worked for 2 days with hmc6352.spin out of the obex on the propeller.
3. now its all over the place, even running backwards, and i made no changes to my program or environment, just woke up on wrong side.
4. tried, .01uf cap vdd to grd, tried slowing clock down (its a 100khz chip. (per datasheet) (am now back to 16x and 5_000_000.
5. tried 6000msec delay (per datasheet) to get heading
6. I can identify 2 out of the 3 resistors as going from vdd to sda and vdd to scl (if i typed this right)
7. i don't know what the third one does
Q:
A. in hmc6352.spin, on what line number does the necessary "A" command reside? (just checking)
B. is there any straight line code to run this thing (like arduino) or must I use 16 subroutines out of a library to define something i ain't smart enough to do on my own? (now u know)
C. Actual ideas that might be cogent besides A and B
tnx
eddie
compass is a parallax product purchased from sparkfun and resides on a little red board with 3 10k resistors on it
Quickstart propeller bd
win xp
1. this compass and an identical one that i readdressed to 0x40 work simultaneously and flawlessly on an arduino uno.
2. This compass worked for 2 days with hmc6352.spin out of the obex on the propeller.
3. now its all over the place, even running backwards, and i made no changes to my program or environment, just woke up on wrong side.
4. tried, .01uf cap vdd to grd, tried slowing clock down (its a 100khz chip. (per datasheet) (am now back to 16x and 5_000_000.
5. tried 6000msec delay (per datasheet) to get heading
6. I can identify 2 out of the 3 resistors as going from vdd to sda and vdd to scl (if i typed this right)
7. i don't know what the third one does
Q:
A. in hmc6352.spin, on what line number does the necessary "A" command reside? (just checking)
B. is there any straight line code to run this thing (like arduino) or must I use 16 subroutines out of a library to define something i ain't smart enough to do on my own? (now u know)
C. Actual ideas that might be cogent besides A and B
tnx
eddie
Comments
This is a discontinued product for Parallax, so the webpage for it on Parallax's website is floating somewhere in hyperspace and I can't find the sample code to answer your questions about hmc6352.spin. You could attach your copy of the code or a link to an OBEX entry to a reply and I'd take a look at it. Regarding #s 1-7: This sounds like something that a call to Parallax Tech Support would get you some answers that the forum here may not be able to do.
Sorry you're having odd difficulties. Be patient
i'm looking hard for the obex reference where i got this, i can only find it on my android!#? yipers
may not be able to get it again.
The code in Main is not indented properly. Statements that are at the same nesting level should be indented the same. Don't indent successive lines just for appearance. In this case (Main), it should work, but with more complex statements (IF / REPEAT / etc.) this won't work.
Here's what I got:
1. Original code (probably the same as yours)
2. Schematic of the Parallax board to compare.
3. PDF from the product page.
Hope that helps,
Jim
FILE>ARCHIVE>PROJECT
This way someone can tell if any of the other objects where changed.
@stargazer2050:
The "A" command is defined in the CONstants block as GET_HEADING and is sent to the HMC6352 in line 81 when you call "Heading".
The 8 (PUBlic) routines are Init, Heading, Sleep, WakeUp, StartCalibration, EndCalibration, ReadEEPROM, and ReadRAM. All the other routines are internal (PRIvate) to the HMC6352 object. You can't use them in your program. If you use the BST compiler and specify the appropriate option, any unused routines won't even be compiled into the binary program.
These objects (like HMC6352) serve the same purpose as Arduino libraries. They provide additional functionality, particularly for I/O devices. The whole idea is not to have "straight line code", but to call the routines in the library object. These routines take care of the details of handling the device for you.
Will learn to archive in propeller tool
tech support just told me to buy the 5883l, will do
will find this BST compiler
will cut back on cogs!!!
Eddie,
Not sure if you realize this, but the module you have from Sparkfun is not a Parallax product. They both used the HMC6352 chip, but the boards have different pinouts.
Just checking.
Jim