Skip to main content
Visitor II
January 16, 2018
Question

Customer is having issue with LIS2MDL offset cancellation. Can you help?

  • January 16, 2018
  • 1 reply
  • 1034 views
Posted on January 16, 2018 at 21:24

   Here is their initialization code:

    i2c_LIS2MDL_Read_8Bit(LIS2MDL_WHO_AM_I, &b);

   

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_X_REG_L,0x00);

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_X_REG_H,0x00);

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_Y_REG_L,0x00);

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_Y_REG_H,0x00);

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_Z_REG_L,0x00);

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_OFFSET_Z_REG_H,0x00);

   

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_CFG_REG_A,0b10001100);// temp comp, continuous 100hz data rate

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_CFG_REG_B,0b00000010);// offset cancellation enabled

    i2c_LIS2MDL_Write_8Bit(LIS2MDL_CFG_REG_C,0b00010000);// block data

Does anything need to be modified or added?  Thank you.

    This topic has been closed for replies.

    1 reply

    ST Employee
    January 17, 2018
    Posted on January 17, 2018 at 12:01

    You configuration is correct.

    What kind of issue do you have? Can you please be more specific.

    Visitor II
    January 17, 2018
    Posted on January 17, 2018 at 20:16

    Customer is not able to get the auto offset cancelation working.

    ST Employee
    January 18, 2018
    Posted on January 18, 2018 at 14:40

    It is very vague statement.

    Please provide register dump and datalog of X,Y,Z data with and without offset cancellation.