2021-05-26 12:20 AM
Hi sir,
I have a custom board containing LSM303AGR connected to stm32f407vg via I2C.
I can generate interrupt at INT1 pin.
What is the correct initialization to enable LSM303AGR Accelerometer activity/inactivity function Interrupt 2?
Our initial setting:
LSM303AGR_CTRL_REG1_A = 0x27;
LSM303AGR_CTRL_REG2_A = 0x00;
LSM303AGR_CTRL_REG4_A = 0x00;
LSM303AGR_CTRL_REG5_A = 0x00;
LSM303AGR_CTRL_REG6_A = 0x08;
LSM303AGR_INT2_CFG_A = 0x2A;
LSM303AGR_INT2_THS_A = 0x0F;
LSM303AGR_INT2_DURATION_A = 0x07;
LSM303AGR_Act_THS_A = 0x0F;
LSM303AGR_Act_DUR_A = 0x07;
Thanks,
Willy
2021-05-27 07:40 AM
Hi Willy @Whung.1 ,
are you saying that when you apply the same configuration to INT1 registers the interrupt is triggered, while it is not in the INT2 configuration that you showed?
that's indeed pretty strange.
can I ask you to try to first enable every direction of the motion by setting pins Z/Y/XLIE in register INT2_CFG_A(34h)?
also, try the AOI bit set to 1.
Let me know if this helps
Niccolò
2021-05-30 06:24 PM
Hi sir,
I found the custom schematics is wrong.
Therefore, I can check the interrupt using other gpio pin.
Thanks,
Willy
2021-05-31 12:58 AM
Hi Willy @Whung.1 ,
glad to hear you solved the problem.
keep up the good work
Niccolò