2018-11-09 03:44 AM
Hi All.
I want to configure the filter in such a way that the data in the out registers are not filtered, and the data for interrupt AOI are filtered. But I have filtered data in both the interrupt and the output registers.
My settings of filter: AX_Write (0x21, 0xC1);
Whats wrong?
Solved! Go to Solution.
2018-11-13 02:43 AM
OK, I see.
First of all, you use not allowed configuration:
Please set the HR bit in CTRL_REG4 to 0, it should start to work as expected.
I will check if the "Autoreset on interrupt event" mode can work also in Normal and High-resolution mode.
2018-11-09 04:11 AM
If the FDS bit is 0 the in output registers are without high-pass filter.
Can you read back the CTRL_REG2 value and confirm the configuration?
2018-11-12 05:05 AM
"If the FDS bit is 0 the in output registers are without high-pass filter." - that's the question!
I read back all the registers that have been configured. The read data is the same as what was recorded.
Here are all the settings:
AX_Write (0x20, 0x3f);
AX_Write (0x21, 0xC1);
AX_Write (0x22, 0x40);
AX_Write (0x23, 0x8);
AX_Write (0x32, 10);
AX_Write (0x33, 0x00);
AX_Write (0x30, 0x2A);
AX_Write (0x24, 0x00);
AX_Write (0x2E, 0x00);
I calculate the angle by acceleration, after the interruption the filter is reset and the calculation of the angle becomes incorrect. If I use AX_Write (0x21, 0x00); angle is calculated correctly. However, I cannot use this setting, because along with the angle I need to detect the presence of movement, and for this I use an interrupt and a filter in Autoreset mode.
2018-11-12 05:58 AM
Can you share a data which you read with the configuration 0xC1 in register 0x21 in case the device is steady?
2018-11-12 10:53 PM
Whith out filter:
0x20 = 2F
0x21 = 0
0x22 = 40
0x23 = 8
0x32 = A
0x33 = 0
0x30 = 2A
0x24 = 0
0x2E = 0
Acc_X = -1
Acc_Y = -1
Acc_Z = 63
Acc_X = -1
Acc_Y = -1
Acc_Z = 63
Acc_X = -1
Acc_Y = -1
Acc_Z = 63
device rotated 180 degrees
Acc_X = 9
Acc_Y = -4
Acc_Z = -43
Acc_X = 0
Acc_Y = -1
Acc_Z = -63
Acc_X = 0
Acc_Y = 0
Acc_Z = -62
Acc_X = 0
Acc_Y = -1
Acc_Z = -62
device rotated back
Acc_X = 38
Acc_Y = 10
Acc_Z = -9
Acc_X = 0
Acc_Y = -2
Acc_Z = 64
Acc_X = -1
Acc_Y = -2
Acc_Z = 63
after rotate 360 degrees the accelerometer shows the same data as before turning.
Whith filter:
0x20 = 2F
0x21 = C1
0x22 = 40
0x23 = 8
0x32 = A
0x33 = 0
0x30 = 2A
0x24 = 0
0x2E = 0
Acc_X = 0
Acc_Y = -16
Acc_Z = 16
Acc_X = 0
Acc_Y = -16
Acc_Z = 16
Acc_X = 0
Acc_Y = -16
Acc_Z = 16
device rotated 180 degrees
Acc_X = 112
Acc_Y = 96
Acc_Z = -32
Acc_X = 48
Acc_Y = 0
Acc_Z = 80
Acc_X = 48
Acc_Y = 0
Acc_Z = 80
Acc_X = 48
Acc_Y = 0
Acc_Z = 80
device rotated back
Acc_X = -96
Acc_Y = -96
Acc_Z = -16
Acc_X = -16
Acc_Y = -16
Acc_Z = 16
Acc_X = -16
Acc_Y = -16
Acc_Z = 16
after turning 360 degrees, the accelerometer shows other data.
2018-11-13 02:43 AM
OK, I see.
First of all, you use not allowed configuration:
Please set the HR bit in CTRL_REG4 to 0, it should start to work as expected.
I will check if the "Autoreset on interrupt event" mode can work also in Normal and High-resolution mode.
2018-11-13 02:56 AM
Miroslav, thanks for your time. The device worked as it should after setting the HR bit to 0.
2018-11-19 07:03 AM
One more thing:
"Autoreset on interrupt event" high-pass filter mode can work in High-resolution sensor mode only if FDS bit is set to 1. In case accelerometer raw data (not high-pass filtered) are needed on output data registers, Normal or Low Power mode has to be used.