more help

can anybody show to me
how to make wiring Hitachi® HM55B Compass Module to pic
and i use pic 16f877a
Hitachi® HM55B Compass Module is a analog or digital component?

please don’t double post, you posted once, if you posted on the incorrect forum your post will be move to the correct one.

He actually posted in the programming forum regarding programming the device and in the electrical forum regarding wiring the device. While his concerns probably could have been addressed in a single post, I don’t think it’s that bad to try and separate it out.

This document should help explain the operation of the compass:

The device uses a synchronous serial interface which means there are either 3 pins that will need to be connected to Digital IO pins on the PIC.

With regards to the programming, the ease of programming this device will likely depend on your familiarity with C programming in general and specifically programming for the PIC you are using. The software does not look overly complex and it should be possible to write what you need. You will learn a lot more from this then from just taking code from somewhere.

EDIT: Looks like from your other post that you are using a language called PICBasic. I don’t know anything about that language, but it will likely be much closer to the BASICStamp code in the linked document than anything else. If your software is the PICBasic Compiler PRO you will be able to actually compile the BasicStamp files directly to your PIC.

XXShadowXX other post in programming
i ask for programming
and this post ing technical for wiring
i think i do for the right thing and put my post in the right one

i just confius forr this component
like encoder we just cant use pin a4 for pic16877a cause its analog component
and pin a4 is a special pin
but for this component i dont understand
which pin should i use
pin analog or digital

This component requires 3 digital pins. 1 for Clock, 1 for Enable and 1 for Digital In/Digital Out

I would point you to this page that I found while doing a simple google search. While they use a pic 18f252, from what I can figure out, it should work for your pic 16f877a as well. Includes wiring diagrams, code sample, and basic explanation of the compass module.

To figure out which pins correspond to which data lines on your microcontroller, I would point you to the Microchip website, specifically the data sheet for your particular uP. Make sure you look at the correct pin diagram, as that datasheet is for the whole family of PICs.

I’ve done next to nothing with PIC Basic, but I did notice that the code sample uses some of the Pro extensions to the langauge. Since it looks like you’re not using the Pro version, you may be missing some of the commands. The key commands are SHIFTIN and SHIFTOUT. In case your version of PIC Basic doesn’t include these, there appear to be “home made” versions of the commands on this webpage.

Let us know if you run into any problems.

Good luck,

thanks for the information
i will do for my best