This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hmc 5883 interface with AT89S52

hi,
i'm trying to access hmc 5883l compass sensor from the at89s52 controller via i2c protocol. I'm unable to correctly collect the data. need urgent help.

Parents Reply Children
  • hi,
    I'm new to this forum, I'm extremely sorry that my question was a bit rough.
    coming to the problem.
    i'm referring the correct device address (0x3c) as prescribed by the data sheet.
    i've set the device in continuous measurement mode 0x3c 0x02 0x00
    then i'm reading the 6 registers for the data. in the format specified below
    0x3c 0x03
    0x3d read operation

    0x3c 0x04
    0x3d read operation

    0x3c 0x05
    0x3d read operation

    till

    0x3c 0x08
    0x3d read operation.

    after this i'm trying to display them by first concatenating the lsb and msb data.