AnsweredAssumed Answered

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

Question asked by minnelli.mike.001 on Jan 16, 2018
Latest reply on Jan 18, 2018 by Miroslav B

   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.

Outcomes