I am trying to get data over i2c from LIS2DE12 sensor. Here I am attaching a screenshot so you can see the way I am configuring its register to read data for x,y and z axis. I dont want to use any interrupt. Simply want to read data.
Can you please explain exactly what is the problem?
I want to get data from LIS2DE12 sensor continuously. I have made configuration to fetch data for x,y and z. But I am not sure wheather they are perfectly configured or not because I am getting same data every time I run the program even if I move the sensor the data remains same. Can you help me with this with proper step by step procedure.
Please share the sensor configuration in some easily readable format (register + value).
Thanks for reply.
I want fetch data from LIS2DE12 sensor continuously over I2C. I have configured this sensor as given below.
Below is how I am trying to fetch data from LIS2DE12 sensor. But getting same data again and again even if I move sensor, data dose not get changed.
HAL_I2C_Mem_Read(&hi2c3 ,ACC_ADDR | 1 , (0x80 | 0x28) , I2C_MEMADD_SIZE_8BIT , rx_buffer , 6 ,10 );
I am continuously monitoring rx_buffer in watch window. This is what I get in rx_buffer every time I run the program and even I move sensor. No change.
This is how I have configured and trying get data from sensor but not able to fetch properly.
You enable FIFO and used mode called "FIFO mode".In FIFO mode, the buffer continues filling data from the X, Y and Z accelerometer channels until it is full (a set of 32 samples stored). When the FIFO is full, it stops collecting data from the input channels and the FIFO content remains unchanged.
So I suppose the FIFO is full and stops collecting data.
Do you really need to use FIFO?
As first step I would propose do test it without FIFO CTRL_REG5 = 0x00, FIFO_CTRL_REG = 0x00.
Thanks for your suggestion. its work.
If i use data ready interrupt in INT1 pin. then which configuration i do?
To enable DRDY interrupt on INT1 pin set the bit I1_ZYXDA in the CTRL_REG3.
Retrieving data ...