2016-11-14 02:42 AM
Hello everybody,
I am trying to apply the built in high pass filter of an LIS3DH to all 3 axis. For the x and y axis this works beautifully: When I rotate the board by 90� I see the peak in the data and flattening out again. This seems not to work with the Z-Axis. I always get about 1g when I leave it lying on my desk z-axis towards earth... I don't see any possibility to configure the axes that are used for high pass filtering... I am using the lis3dh_driver from ST with the following settings:/* enable the accelerometer */
LIS3DH_SetODR(LIS3DH_ODR_10Hz); /* enable all axes */ LIS3DH_SetAxis(0x07); /* full scale = 2g */ LIS3DH_SetFullScale(LIS3DH_FULLSCALE_2); /* Enable block data update, so unread previous data will just be dismissed */ LIS3DH_SetBDU(MEMS_ENABLE); /* big endian data selecten: LSB @ lower address */ LIS3DH_SetBLE(LIS3DH_BLE_LSB); /* set fifo to stream mode and enable it */ LIS3DH_FIFOModeEnable(LIS3DH_FIFO_STREAM_MODE) /* set low power mode and 8 bit resolution, start the measruements */ LIS3DH_SetMode(LIS3DH_LOW_POWER); /* set high pass filter mode */ LIS3DH_SetHPFMode(LIS3DH_HPM_NORMAL_MODE); LIS3DH_SetHPFCutOFF(LIS3DH_HPFCF_0); LIS3DH_SetFilterDataSel(MEMS_ENABLE); Any Idea how I could make the high pass filter work on the z-axis as well? thanks for you replies Alexander #lis3dh-highpass2016-11-30 05:45 AM
You can try to reset the HP filter by reading register 0x26h (according to application note AN3308).
Just to check, can you please explain what the following functions do?LIS3DH_SetHPFMode(LIS3DH_HPM_NORMAL_MODE);
LIS3DH_SetFilterDataSel(MEMS_ENABLE);
Basically you should set the CTRL_REG2 (21h) to 0x08h to get high pass filtered data.
Best regards
Miroslav