LIS3MDL configuration

Discussion created by Laga.Freya on Feb 17, 2017
Latest reply on Mar 3, 2017 by Laga.Freya

Hi to all,
I got a problem with LIS3MDL magnetometer, that is I am not able to retrieve data from it.
I initialize it as follow:
0x20B0    that is CTRL_REG1 ->0xB0    // Enable temperature sensor | XY medium performance
0x2100    that is CTRL_REG2 ->0x00    // Set full scale range
0x2200    that is CTRL_REG3 ->0x00    // Continuous conversion mode (0x00 = continuous 0x11 = Power down)
0x2304    that is CTRL_REG4 ->0x04    // Z medium performance
0x2400    that is CTRL_REG5 ->0x00    // Contimum registers update


Then I read OUT_X_H, OUT_X_L and so on for all axes, but I get only 0xFF as response from all registers.
I tried also all combinations of CPOL and CPHA, but nothing changes.


I have other sensors on the same SPI line (such as LIS302) and they work, so I do not think it could be a SPI problem.


Ddi I forget something in configuration?


Thnak you