Skip to main content
Visitor II
May 26, 2021
Question

LSM303AGR Accelerometer can't generate interrupt at INT2 pin

  • May 26, 2021
  • 2 replies
  • 916 views

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

    This topic has been closed for replies.

    2 replies

    ST Employee
    May 27, 2021

    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.1Author
    Visitor II
    May 31, 2021

    Hi sir,

    I found the custom schematics is wrong.

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

    Thanks,

    Willy

    ST Employee
    May 31, 2021

    Hi Willy @Whung.1​ ,

    glad to hear you solved the problem.

    keep up the good work

    Niccolò