LSM9DS1 Same value for magnetometer axis X Y Z
Hello,
I'm using a LSM9DS1 for a project, accelerometer and gyroscope works well, but the magnetometer have some problems.
Every measure I get the same value for axis X-Y-Z , and it seems to change randomly, see the log :
12:59:38 : ACC : x: 0.142378 y: 0.278774 z: -9.767851
12:59:38 : GYR : x: -0.000305 y: -0.083536 z: 0.003512
12:59:38 : MAG : x: 4.292928 y: 4.292928 z: 4.292928
12:59:39: ACC : x: 0.125628 y: 0.273988 z: -9.792976
12:59:39: GYR : x: 0.004123 y: -0.072693 z: 0.004429
12:59:39: MAG : x: -3.811968 y: -3.811968 z: -3.811968
12:59:39 :TEMP: 25.125000
12:59:40: ACC : x: 0.101699 y: 0.259631 z: -9.781012
12:59:40: GYR : x: -0.001222 y: -0.076205 z: 0.005956
12:59:40: MAG : x: -4.182048 y: -4.182048 z: -4.182048
12:59:40: TEMP: 24.375000
I'm using an SPI 4 wire, and the registers configuration is :
Acc/Gyro:
CTRL_REG1_G = 0xC0
CTRL_REG4 = 0x38
CTRL_REG5_XL = 0x38
CTRL_REG6_XL = 0xD0
Magnetometer:
CTRL_REG1_M = 0x7C
CTRL_REG2_M = 0x00
CTRL_REG3_M = 0x00
CTRL_REG4_M = 0x0C
Anyone have any idea of the problem ?
Regards
Riccardo
