problem with HMC6352 compass


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I saw that code. I actually have one module that is useless because I tried using that code to
    calibrate. I don't know exactly what happened, maybe the timing is off on that routine also, but
    the module never worked the same since. I will tweek the calibration code and see if I can restore
    the calibration to a useable level.

    Nick

  2. #2
    javierch's Avatar
    javierch Guest


    Did you find this post helpful? Yes | No

    Default Re: problem with HMC6352 compass

    Hello,

    I have any problem with my code.
    I am working with HMC6352 in PROTON but i have any problem with the sensor. I don`t know what happen, Please could you help me?

    This is the code

    device = 16f876
    xtal 20

    declare SDA_PIN PORTB.0
    DECLARE SCL_PIN PORTB.1

    DIM LSB AS WORD
    DIM MSB As WORD
    Main:
    BusouT $42,[$43]
    DELAYUS 10
    DELAYMS 10000
    BUSOUT $42,[$45]
    DELAYMS 14
    BUSOUT $42,[$4F]
    DELAYMS 6
    while 1=1
    busout $42,[$41]
    delayms 10
    busin $43,[MSB, LSB]
    HRSOUT "VALOR MSB ", DEC mSB, "LSB ", DEC LSB, 13
    DELAYMS 500
    wend
    GOTO mAIN

    The problem is that LSB date is incorrect. It is not read. Always show 65535 as value of LSB.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts