cancel
Showing results for 
Search instead for 
Did you mean: 

IIS2DLPC interrupts not generated

KS.9
Associate II

Hello

I have been trying to setup 6D orientation interrupt using IIS2DLPC and I am not getting any interrupts on INT1 pin when the orientation changes beyond threshold.

For debugging I tried printing SIXD_SRC (3Ah)  and ALL_INT_SRC (3Bh)  registers. In the SIXD_SRC register I am seeing the bit 6D_IA (a change in position is detected) is set and in register ALL_INT_SRC I am seeing the bit 6D_IA (a change in position detected) is also set but no interrupts are generated.

I have also tried changing Interrupt active high/low and Latched Interrupt settings both didnt work. Also tried adding internal pullup and pulldown from the micro controller that also didn't work.

I2C settings done for 6D orientation interrupt:

1. Write 64h in CTRL1 // Turn on the accl // ODR = 200 Hz, High-Performance

2. Write 04h in CTRL6 // FS ±2 g, LOW_NOISE enabled

3. Write 20h in CTRL7 // Do not use low-pass filter for 6D, enable interrupts

4. Write 40h in TAP_THS_X // Set 6D threshold (6D_THS[1:0] = 10b = 60 degrees)

5. Write 80h in CTRL4_INT1_PAD_CTRL // 6D interrupt driven to INT1 pin 

Am I missing something or should I be doing anything extra?

6 REPLIES 6
Eleon BORLINI
ST Employee

Hi @KS.9​ ,

you can compare your code with the official C example on Github repository for the IIS2DLPC (in particular, this file: iis2dlpc_orientation.c).

The only difference I can see is that the ODR is configured after the other settings are ready done and that the LPASS_ON6D bit of CTRL7 (3Fh) register has been enabled, so:

3. Write 21h in CTRL7 // Use low-pass filter for 6D, enable interrupts

 /*Restore default configuration */
  iis2dlpc_reset_set(&dev_ctx, PROPERTY_ENABLE);
  do {
    iis2dlpc_reset_get(&dev_ctx, &rst);
  } while (rst);
 
  /*Set full scale */
  iis2dlpc_full_scale_set(&dev_ctx, IIS2DLPC_2g);
 
  /*Configure power mode */
  iis2dlpc_power_mode_set(&dev_ctx, IIS2DLPC_CONT_LOW_PWR_LOW_NOISE_12bit);
 
  /*Set threshold to 60 degrees */
  iis2dlpc_6d_threshold_set(&dev_ctx, 0x02);
 
  /*LPF2 on 6D function selection. */
  iis2dlpc_6d_feed_data_set(&dev_ctx, IIS2DLPC_LPF2_FEED);
 
  /*Enable interrupt generation on 6D INT1 pin. */
  iis2dlpc_pin_int1_route_get(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);
  int_route.ctrl4_int1_pad_ctrl.int1_6d = PROPERTY_ENABLE;
  iis2dlpc_pin_int1_route_set(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);
 
  /*Set Output Data Rate */
  iis2dlpc_data_rate_set(&dev_ctx, IIS2DLPC_XL_ODR_200Hz);

Please check your application with this modified configuration and let me know.

-Eleon

Hi @Eleon BORLINI

Thanks for the response.

I tried the orientation example given in the Github repository still I am not getting interrupts.

I have also tried other examples there also I am not getting any interrupts.

Hi @KS.9​ ,

but are you getting correct acceleriation values when you just read the output registers?

-Eleon

KS.9
Associate II

Hi @Eleon BORLINI​ 

The acceleration values from the output registers are correct.

Thanks

KS

Hi @KS.9​ ,

sorry for the delayed feedback... Did you try to run your code with other IIS2DLPC samples?

-Eleon

msingh08
Associate II

Has this been resolved? I am facing a similar issue, I am not getting any interrupt nor I see anything being set in the SIXD_SRC register as it's always reporting 0. however if I read the Output registers (OUT_Y_LOW, OUT_Y_HIGH, OUT_Z_LOW, OUT_Z_HIGH) I see the correct data and it seems to work fine.