I2C Reading Valus (0x80 | OUT_X_L_G)

Home Forums Forums Technical Support for BerryIMU I2C Reading Valus (0x80 | OUT_X_L_G)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4901
    jingram
    Participant

    Hi

    When reading the values for the Gyro, why do you offset the address by or'ing OUT_X_L_G with 0x80

    The Gyro is initialised in Bypass mode, so the latest single value in the FIFO will always be written to OUT_[XYZ]_[LH]_G registers after being read (From what I understand in the spec sheet)

    If I only output d/s sampling from 0x80 | OUT_X_L_G .. I do not get 0 values for the gyro being stationary.
    If I read only from OUT_X_L_G, I get a 0 value and changing values when moving.

    Please can you advise what the 0x80 is for?

    #4902
    Mark Williams
    Keymaster

    It is needed with reading multiple bytes and increments the FIFO. From the datasheet:

    In order to read multiple bytes, it is necessary to assert the most significant bit of the subaddress field. In other words, SUB(7) must be equal to 1 while SUB(6-0) represents the
    address of first register to be read

    0x80 = b10000000

    Mark --OzzMaker.com --

    #4903
    jingram
    Participant

    Hi

    Thanks Mark.
    That line was way deep in the spec sheet.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop...