Facing problem while fetching data from LIS2DE12 over I2C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-07 4:10 AM
Hello People,
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-07 5:45 AM
Can you please explain exactly what is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-07 9:09 PM
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.Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-10 8:17 AM
Please share the sensor configuration in some easily readable format (register + value).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-11 10:26 PM
Hi Misroslav
Thanks for reply.
I want fetch data from LIS2DE12 sensor continuously over I2C. I have configured this sensor as given below.
- CTRL_REG0 = 0x10 // (0: pull-up connected to SDO/SA0 pin )
- CTRL_REG1 = 0x7F // ODR = 200Hz, LPen = 1, All axis enabled
CTRL_REG4 = 0x00 // Continuously data updation, 2g, Normal mode
CTRL_REG5 = 0x40 // Fifo enable
FIFO_CTRL_REG= 0x40 // Fifo mode selection
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.
while (1)
{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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-12 2:57 AM
Hi Moroslav
Thanks for your suggestion. its work.
If i use data ready interrupt in INT1 pin. then which configuration i do?
Thanks
Nitin Kanani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-12 3:27 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-12 8:14 AM
To enable DRDY interrupt on INT1 pin set the bit I1_ZYXDA in the CTRL_REG3.
