AnsweredAssumed Answered

LIS2DS12 wrong output data

Question asked by Attila . on Nov 22, 2017
Latest reply on Nov 28, 2017 by Attila .

Hi everyone!

 

I'm working with the LIS2DS12 accelerometer chip with STM32F4xx via SPI. I could make the sensor alive, configure it (configuration is checked by an SPI read back) to operate in FIFO mode with threshold interrupt on INT1 pin which works properly (checked on scope). My problem is that somehow the read values are not correct. During the configuration I have set the IF_ADD_INC bit in CTRL2  register, so if I make a read request onto the OUT_X_L (0x28), then I could read out the all the bytes from the FIFO (256x6 bytes) in one read sequence in the repeating order of X_LSB;X_MSB;Y_LSB;Y_MSB;Z_LSB;Z_MSB. Then I have made the scaling onto [mg], which showed good results at the Y and Z axis. I could measure the Earth's 1g "force" correctly. But all of my x axis values are corrupted. They show ~10.000 mg values. Also on oscilloscope I have tracked the communication and I could see they are all wrong. As a side movement I have tested the device in bypass mode and I have only read the x axis values, but it was still corrupted. I have changed the eval board (STEVAL-MKI175V1 ), but it didn't help. Unfortunatelly I don't have the code with me, but I'm using the official HAL SPI functions. Does anybody had this type of miscellaneous error earlier?

 

Thank you in advance for any kind of help!

 



Outcomes