2018-01-25 09:52 AM
Hi,
My problem is I can not receive the interrupt signal of INT1 when I using FIFO mode with FIFO buffer full trigger. I find the cause is that the INT1 is always at high, but I expect it should be rise high when FIFO buffer is full.
My HW is
(LIS2DW12TR), I using the following pins for I2C
SCL, SDA, VDD, GND, SA0 (connect to
GND)
My Pin configuration for INT1 on MCU side is
PIN_GPIO_LOW | PIN_PUSHPULL| PIN_IRQ_POSEDGE
SW startup sequence:
if(LIS2DW12_getRegisterValue(LIS2DW12_WHO_AM_I_ADDR) == LIS2DW12_WHO_AM_I_DEF)
{
LIS2DW12_setRegisterValue(
LIS2DW12_CTRL2_ADDR
, LIS2DW12_BDU_MASK | (commProtocol << 4)); // set BDU on and CS_PUDISCLIS2DW12_setRegisterValue(
LIS2DW12_CTRL4_INT1_PAD_ADDR
, LIS2DW12_INT1_FIFO_FULL_MASK); //triger PIN INT1 when FIFO buffer is fullLIS2DW12_setRegisterValue(
LIS2DW12_CTRL6_ADDR
, LIS2DW12_FS_CODE(fullScaleCode)); //set full scale codeLIS2DW12_setRegisterValue(
LIS2DW12_FIFO_CTRL_ADDR
, LIS2DW12_FIFO_MODE(LIS2DW12_FIFO_FIFO) | LIS2DW12_SAMPLES(FIFOBuffSize-1)); //set FIFO mode and FIFO buffer sizeLIS2DW12_setRegisterValue(
LIS2DW12_CTRL7_ADDR
, LIS2DW12_CTRL7_INTERRUPTS_ENABLE_MASK); //enable the interruptsLIS2DW12_setRegisterValue(
LIS2DW12_CTRL1_ADDR
, LIS2DW12_ODR_SELECTION(LIS2DW12_bandWithCode) | LIS2DW12_POWER_MODE(LIS2DW12_powerMode));}
The above setting of register is showing on following table. The yellow mark label is 1.
I also read the registers after setting
LIS2DW12_CTRL1_ADDR
and the result is :0x18 (00011000) = LIS2DW12_getRegisterValue(LIS2DW12_CTRL2_ADDR);
0x04
(00000100)
= LIS2DW12_getRegisterValue(LIS2DW12_CTRL4_INT1_PAD_ADDR);
0x30
(00110000)
= LIS2DW12_getRegisterValue(LIS2DW12_CTRL6_ADDR);
0x3F
(00111111)
= LIS2DW12_getRegisterValue(LIS2DW12_FIFO_CTRL_ADDR);
0x10 (00010000)= LIS2DW12_getRegisterValue(LIS2DW12_CTRL7_ADDR);
0x24
(00100100)
= LIS2DW12_getRegisterValue(LIS2DW12_CTRL1_ADDR);
I also test the INT1 status. The INT1 of MCU is low if I don't connect it to
, but it will always be high after I connect it to .Please help me to check my configuration of registers and startup sequence.
Thank you for your helping.
Best Regards,
Allen
#fifo-buffer-interrupt #fifo-buffer #lis2dw12 #lis2dw2018-01-26 09:19 AM
I checked you configuration and it seems to be correct.
In my case the interrupt goes high if the FIFO is full, and it is cleared if read a sample from FIFO or turn off the FIFO.
Can you please try to turn off the FIFO FIFO_CTRL (0x2E) = 0x00 and check the state of INT1 pin?
Are you sure you configured the interrupt in in the microcontroller as input?