LIS3DSH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-05 6:13 AM
Hi,
I interfaced LIS3DSH with Nordic controller(PCA10040). I am facing following issues:
- Data is repeating in Y-Axis.
- Data is coming 0 for 3 times continously in I2C read buffer.
- In X-axis same data is coming for 4 seconds data like 1964
please suggest any ways to solve this problems.
for your reference I am attaching data
Thanks & Regards,
Chaitanya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-05 7:27 AM
Hi @chaitanya chippada​ , a few questions to understand the issue: are you correctly converting raw data into 16-bit two's complement data? Are you reading data in continuous mode and at which ODR? Vdd and VddIO have the same value? Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-07 10:22 PM
Hi Eleon,
Thanks for your reply,
are you correctly converting raw data into 16-bit two's complement data?
A. Yes, we are converting correctly, as some other data points is correct, following is the function we are using for converting raw value to g value.
int16_t two_compl_to_int16(uint16_t two_compl_value)
{
int16_t int16_value = 0;
/* conversion */
if (two_compl_value > 32768) {
int16_value = (int16_t)(-(((~two_compl_value) & (uint16_t)(0xFFFF)) + (uint16_t)(1)));
} else {
int16_value = (int16_t)(two_compl_value);
}
return int16_value;
}
Are you reading data in continuous mode and at which ODR?
A. we are reading data from sensor continously (stream mode)by giving required delay, for your reference I am attaching configured parameters, please suggest if any other settings required.
ret_code_t err = NRF_SUCCESS;
uint8_t reg[2] = {0x00};
reg[0] = MEMS_SENSOR_CTRL_REG4_ADDR;
reg[1] |= DATARATE_1600;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG4_ADDR;
reg[1] |= XYZ_ENABLE;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG3_ADDR;
reg[1] = 0x00;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG5_ADDR;
reg[1] |= FILTER_BW_800;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG5_ADDR;
reg[1] |= FULLSCALE_2;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG5_ADDR;
reg[1] |= (SELFTEST_NORMAL | SERIALINTERFACE_4WIRE);
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_CTRL_REG6_ADDR;
reg[1] |= (FIFO_ENABLE | AUTO_ADDRESS_INCREMENT);
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
reg[0] = MEMS_SENSOR_FIFO_CTRL_ADDR;
//reg[1] |= FIFO_STREAM_MODE;
reg[1] = FIFO_STREAM_MODE;//0x40;//0x54;
err = writeTolis3dsh(®[0], sizeof(reg));
APP_ERROR_CHECK(err);
Vdd and VddIO have the same value?
A. Yes, Vdd & VddIO is same value 3.3 V
Thanks for your quick support,
Regards,
chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-09 2:37 AM
a few questions to understand the issue:
are you correctly converting raw data into 16-bit two's complement data?
A. Yes we are correctly converting raw data
Are you reading data in continuous mode and at which ODR?
A. We are reading in stream mode with 1.6KHz ODR
Vdd and VddIO have the same value?
VDD and Vddio have same value 3.3volts
Regards,
chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-24 7:14 AM
Do you have the same issue also at lower ODR? Regards
