LSM303AGR Accelerometer activity/inactivity function not able to generate interrupt at INT2 pin?
Hi,
I am using STEVAL-MKII72V1 with LSM303AGR. I use TI CC2640R2F Launchpad to communicate to the LSM303AGR using I2C interface.
I have successfully generated LSM303AGR Interrupt 1 pin interrupt when activity threshold exceed 256 mg. I connect the LSM303AGR to a led on the TI CC2640R2F Launchpad. The led lights up whenever I move the LSM303AGR board.
But, I want to use the LSM303AGR Accelerometer activity/inactivity function, which will transition from Low Power Mode to Normal Mode. This functionality will reduce power consumption. The problem I am unable to generate a Interrupt 2 interrupt. Here is my initialization code below. The code below is a simplified version for sharing. What is the correct code initialization to enable LSM303AGR Accelerometer activity/inactivity function Interrupt 2.
// X, Y and Z-axis enable, power on mode, o/p data rate 10 Hz(0x27
LSM303AGR_CTRL_REG1_A |= 0x27;
// Full scale +/- 2g, continuous update(0x00)
LSM303AGR_CTRL_REG4_A |= 0x00;
// CTRL_REG6A(0x25H) P2_ACT Bit to 1
LSM303AGR_CTRL_REG6_A |= 0x08;
// INT2_CFG_A(0x34H) OR Combination of Interrupt Events
LSM303AGR_INT2_CFG_A |= 0x2A;
// 16 x 16mg = 256mg Threshold
LSM303AGR_Act_THS_A |= 0x0F;
// Set Activity Duration 1 LSb = (8*1[LSb]+1)/ODR
LSM303AGR_Act_DUR_A |= 0x07;
Regards,
Markel
