cancel
Showing results for 
Search instead for 
Did you mean: 

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

Mike Minnelli
Associate
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.

3 REPLIES 3
Miroslav BATEK
ST Employee
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.

Posted on January 17, 2018 at 20:16

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

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.