2020-09-07 07:23 AM
We have a small percentage of devices that once powered on show a certain issue.
One or more axes of the accelerometer values are capped to the max or minimum value.
This issue disappears when the device is powered off and powered back on.
All the registers from the LIS2DW12 on a device that exhibits this issue.
0 to 0x3F:
0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 253, 68, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 32, 22, 0, 0, 0, 4, 253, 0, 240, 127, 0, 128, 240, 127, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
When reading the accelerometer values of one of the devices this is the raw result we get
reading OUT_X_L for 6 bytes.
240, 127, 0, 128, 240, 127
We have some devices where only one axis exhibits this behavior, but others do not.
We believe this issue could be caused by unstable power during startup.
We use the following code to setup the accelerometer:
ACC_WriteByte(CTRL2, 0b00010110);
ACC_WriteByte(CTRL6, 0b00000100);
ACC_WriteByte(FIFO_CTRL, 0b11000000);
ACC_WriteByte(CTRL1, 0b00100000);
A soft reset does not fix this issue.
Any help would be greatly appreciated.
2020-09-09 04:40 PM
maybe slow it down, do you have a scope to check the pins ?
did you make your own boards and one is faulty ? maybe it needs to be reflowed. best to remove the processor clean the PCB and replace it.
it could be the LIS2D is not mounted correctly, that may need reflowing too.
2020-09-10 12:56 AM
We have no direct access to the pins to monitor them with a scope / logic analyzer.
Why would you want to monitor the pins?
I have control over the MCU so I can read out / write every register, it is not a communication issue between the MCU and accelerometer.
Because this issue dissapears when turning off&on the device we believe there is no hardware issue in the sense of faulty manufacturing.
The boards are made in a factory.
Reflowing the board without turning off&on the device is going to be hard, same with the removal of the processor and cleaning the PCB.
2020-09-17 08:01 AM
Hi @MDW ,
How did you set configured your LIS2DW12 devices?
For example, did you set the BDU bit in register CTRL2 (21h), which blocks the output registers' update until MSB and LSB are read.
You can check if you properly configured your device by comparing your code with this example lis2dw12_read_data_polling.c, that you can find in the Github repository.
/* Restore default configuration */
lis2dw12_reset_set(&dev_ctx, PROPERTY_ENABLE);
do {
lis2dw12_reset_get(&dev_ctx, &rst);
} while (rst);
/* Enable Block Data Update */
lis2dw12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
/* Set full scale */
//lis2dw12_full_scale_set(&dev_ctx, LIS2DW12_8g);
lis2dw12_full_scale_set(&dev_ctx, LIS2DW12_2g);
/* Configure filtering chain
* Accelerometer - filter path / bandwidth
*/
lis2dw12_filter_path_set(&dev_ctx, LIS2DW12_LPF_ON_OUT);
lis2dw12_filter_bandwidth_set(&dev_ctx, LIS2DW12_ODR_DIV_4);
/* Configure power mode */
lis2dw12_power_mode_set(&dev_ctx, LIS2DW12_HIGH_PERFORMANCE);
//lis2dw12_power_mode_set(&dev_ctx, LIS2DW12_CONT_LOW_PWR_LOW_NOISE_12bit);
/* Set Output Data Rate */
lis2dw12_data_rate_set(&dev_ctx, LIS2DW12_XL_ODR_25Hz);
-Eleon