cancel
Showing results for 
Search instead for 
Did you mean: 

LSM303AGR Accelerometer can't generate interrupt at INT2 pin

Whung.1
Associate

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

3 REPLIES 3
niccolò
ST Employee

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ò

Whung.1
Associate

Hi sir,

I found the custom schematics is wrong.

Therefore, I can check the interrupt using other gpio pin.

Thanks,

Willy

Hi Willy @Whung.1​ ,

glad to hear you solved the problem.

keep up the good work

Niccolò