Question
LIS3DSH FIFO - Interrupt never occurs
Hi!
I'm having trouble to get FIFO to work. Registers write fine, but i think that OVRN flag never sets high.
My config:
CTRL_REG4, 0b01100111 //ODR = 100Hz, BDU = 0, ZYX enabled
CTRL_REG1, 0x00
CTRL_REG2, 0x00
CTRL_REG3, 0b00001000); //Interrupt signals active LOW, Interrupt signal latched, INT1 signal enabled
CTRL_REG5, 0b00000000); //BW = 00 anti aliasing 800Hz, Scale +- 2g, Self test disabled, SPI 4 wire
CTRL_REG6, 0b01000010); //FIFO enable, P1_OVERRUN enable (Interrupt on INT1 from OVERRUN flag)
FIFO_CTRL, 0b01000000); //Stream mode
And my interrupt routine:
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){
if(GPIO_Pin == INT1_Pin){
for(int i = 0; i < 32; i++){
//X
outx_l = LIS3DSH_Read(OUT_X_L);
outx_h = LIS3DSH_Read(OUT_X_H);
outx = ( outx_h << 8 ) | outx_l;
//Y
outy_l = LIS3DSH_Read(OUT_Y_L);
outy_h = LIS3DSH_Read(OUT_Y_H);
outy = ( outy_h << 8 ) | outy_l;
//Z
outz_l = LIS3DSH_Read(OUT_Z_L);
outz_h = LIS3DSH_Read(OUT_Z_H);
outz = ( outz_h << 8 ) | outz_l;
}
}
}Normal mode, and DRDY mode with INT1 interrupt works fine. I think that FIFO never starts filling, when I read FIFO_SRC there is always EMPTY flag high.
I'm using STM32 F407 DISC board.
Thanks for help :)
