Shop OBEX P1 Docs P2 Docs Learn Events
Trying work with Hitachi HM55B Compass Module — Parallax Forums

Trying work with Hitachi HM55B Compass Module

MeiraMeira Posts: 3
edited 2007-10-01 14:39 in General Discussion
Hi. Iam not using·you BASIC Stamp·but·plz·try help me.

Iam trying comunicate with Hitachi HM55B Compass Module by PIC18F4550 with MCC18, but i dont recive the correct status flag.· Iam working with 20Mhz.
·
I translate the code from Basic Stamp2 series test program to MCC18.
The·functions void ShiftOUT (char comando); char TestStatus (void); void ShiftIN (void);·they had been created by me.

In the annexes i send my code and Hitachi HM55B Compass Module documentation.

Plz try help me understand what can be badly.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-28 17:27
    A 20MHz clock to the HM55B is way too fast. Look at the required timings on the HM55B datasheet. Clock high and clock low must be at least 100ns wide. That's no more than a 5MHz clock (for the HM55B).

    If you have further questions about the use of non-Parallax processors, you need to post them to the "Sandbox" forum, not this "BASIC Stamp" forum. You may or may not get help ... mostly because your question is really about the use of the PIC18F4550 processor, not the Parallax product and many of the people who serve as resources here have limited experience with these competing processors, myself included.
  • MeiraMeira Posts: 3
    edited 2007-09-28 18:01
    Just other question.
    The values transmitted to and received from the Compass Module
    are validate in rising edge or falling edge.
    By wave diagram seems that sampling is done on falling edge and not in rising edge like datasheet say.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-28 18:09
    The sampling should indeed be done on the clock's falling edge. The datasheet is correct too. The data presented to the HM55B should be valid on the leading edge of the clock. By waiting until 100ns later (on the falling edge of the clock), you ensure that the data is really valid even if there are further logic delays or heavy loading.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-01 14:39
    This thread is being moved from the BASIC Stamp Forum to the Sandbox Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.