cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH Interrupt for 6D movement detection

Tashfique
Associate II

Hi,

I am trying to make the interrupt work on the the Y-Axis, X-Axis, or Z-Axis.

Here are the outputs I am getting. Threshold set to 960 mg. So when it gets bellow that threshold I am looking for an interrupt on the Z-axis.

0.280: Acceleration [mg]:14.00 16.00 999.00

0.285: Temperature [degC]: 25.00

0.287: Int1 Threshold:0x3c

0.289: Int1 Configuration:0x50

0.291: Int1 Source:0x20

0.293: ctrl_reg3_t:0x40

0.155: Acceleration [mg]:-1027.00 -5.00 -39.00

0.160: Temperature [degC]: 25.00

0.162: Int1 Threshold:0x3c

0.164: Int1 Configuration:0x50

0.166: Int1 Source: 0x01

0.168: ctrl_reg3_t:0x40

set Ctr_reg_6 bit H_LACTIVE to 1.

The pin is constantly held low. If I set H_LACTIVE to 0 its constantly help high. I have configured pin 1 to detect a falling edge.

Maybe I am missing something.

Rest of the settings.

lis2dh_data_rate_set(&dev_ctx, LIS2DH_ODR_25Hz);
 
lis2dh_full_scale_set(&dev_ctx, LIS2DH_2g);
 
lis2dh_int1_gen_threshold_set(&dev_ctx, 0x12);
 
lis2dh_pin_int1_config_get(&dev_ctx, &ctrl_reg3);
 
 ctrl_reg3.i1_ia1 = PROPERTY_ENABLE; lis2dh_pin_int1_config_set(&dev_ctx, &ctrl_reg3);
 
lis2dh_int1_gen_duration_set(&dev_ctx, 0);
 
 
 
_6d_cfg._6d = PROPERTY_ENABLE; 
 
_6d_cfg.aoi = PROPERTY_DISABLE;
 
 _6d_cfg.xlie = PROPERTY_DISABLE;
 
 _6d_cfg.xhie = PROPERTY_DISABLE; 
 
_6d_cfg.ylie = PROPERTY_DISABLE; 
 
_6d_cfg.yhie = PROPERTY_DISABLE; 
 
_6d_cfg.zlie = PROPERTY_ENABLE; 
 
_6d_cfg.zhie = PROPERTY_DISABLE; lis2dh_int1_gen_conf_set(&dev_ctx, &_6d_cfg);
 
 
 
lis2dh_operating_mode_set(&dev_ctx, LIS2DH_HR_12bit);
 
 
 
lis2dh_pin_int2_config_get((ctrl_reg6_t*)&reg.byte);
 
reg.ctrl_reg6.int_polarity = PROPERTY_ENABLE;
 
lis2dh_pin_int2_config_set((ctrl_reg6_t*)&reg.byte);

1 REPLY 1
Tashfique
Associate II

I am getting an interrupt. But its all over the place ... Its not true to what the data sheet is saying. When I turn on orientation I get an interrupt in many directions. Is there any concrete example without polling..

Thanks.