cancel
Showing results for 
Search instead for 
Did you mean: 

LSM9DS0 magnetometer

theo2
Associate
Posted on August 04, 2016 at 11:54

Hi,

I'm working on lsm9ds0 and spi with a stm32f4. The accelerometer and gyroscope work successfully on my device but since a few days, the magnetometer seems to get random values. For test, gyroscope is in power down mode. This is my configuration :

lsm9_driver_write_register(LSM9DS0_CTRL_REG1_XM, (0x60)|(0x07)); // ODR 100HZ, enable all axis, continuous update

lsm9_driver_write_register(LSM9DS0_CTRL_REG2_XM, 0b00100000 ); // ±16 g

lsm9_driver_write_register(LSM9DS0_CTRL_REG5_XM, (0x80)|(0x14) );//  temp enable, low resoluation mag, 100Hz ODR

lsm9_driver_write_register(LSM9DS0_CTRL_REG6_XM, 0b00000000, ); // ±2gauss

lsm9_driver_write_register(LSM9DS0_CTRL_REG7_XM, 0b10000000); // normal mode

lsm9_driver_write_register(LSM9DS0_OFFSET_X_L_M, 0x00);

lsm9_driver_write_register(LSM9DS0_OFFSET_X_H_M, 0x00);

lsm9_driver_write_register(LSM9DS0_OFFSET_Y_L_M, 0x00);

lsm9_driver_write_register(LSM9DS0_OFFSET_Y_H_M, 0x00);

lsm9_driver_write_register(LSM9DS0_OFFSET_Z_L_M, 0x00);

lsm9_driver_write_register(LSM9DS0_OFFSET_Z_H_M, 0x00);

lsm9_driver_write_register(LSM9DS0_REFERENCE_X, 0x00);

lsm9_driver_write_register(LSM9DS0_REFERENCE_Y, 0x00);

lsm9_driver_write_register(LSM9DS0_REFERENCE_Z, 0x00);

Read configuration and transmitted by uart : http://img110.xooimage.com/files/0/a/f/configlsm9-5011236.png

Extract of data send by uart : http://img110.xooimage.com/files/7/5/7/data-5011237.png

When i move sensor, accelerometer values correctly change but the values on magnetometer stay random. In doubt, i use a magnet in proximity, nothing changes. Moreover, four sensors have the same phenomenon of random values.

0 REPLIES 0