cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSl edge-sensitive trigger mode

RHube
Associate

Hello,

I want to use edge-sensitive trigger mode to synchronize multiple sensors. In the code snippet you can see the relevant code for that. The FIFO buffer doesn't get filled, even though I have a PWM as trigger on the INT2 pin. The low-pass filter LPF2 is disabled. Any ideas?

lsm6dsl_fifo_xl_batch_set(&dev_ctx, LSM6DSL_FIFO_XL_NO_DEC); // no decimation
lsm6dsl_fifo_gy_batch_set(&dev_ctx, LSM6DSL_FIFO_GY_NO_DEC); // no decimation
/* FIFO ODR has to be equal or lower than accel and gyro odr */
/* F(odr) = MIN ( MAX(ODR_XL, ODR_G), ODR_FIFO ) */
lsm6dsl_fifo_data_rate_set(&dev_ctx, LSM6DSL_FIFO_833Hz);
lsm6dsl_fifo_watermark_set(&dev_ctx, PL_CONFIG_FIFO_FTH);
lsm6dsl_fifo_mode_set(&dev_ctx, LSM6DSL_STREAM_MODE);
/* Enable Edge-Sensitive Trigger Mode */
#if PL_CONFIG_HAS_EDGE_TRIGGER
  lsm6dsl_den_polarity_set(&dev_ctx, LSM6DSL_DEN_ACT_HIGH);
  lsm6dsl_sh_syncro_mode_set(&dev_ctx, LSM6DSL_EXT_ON_INT2_PIN);
  lsm6dsl_fifo_write_trigger_set(&dev_ctx, LSM6DSL_TRG_SH_DRDY);
  lsm6dsl_den_mode_set(&dev_ctx, LSM6DSL_EDGE_TRIGGER);
  lsm6dsl_den_enable_set(&dev_ctx, LSM6DSL_STAMP_IN_GY_XL_DATA);
#endif
 
lsm6dsl_xl_data_rate_set(&dev_ctx, LSM6DSL_XL_ODR_833Hz);
lsm6dsl_gy_data_rate_set(&dev_ctx, LSM6DSL_GY_ODR_833Hz);

2 REPLIES 2
Miroslav BATEK
ST Employee

I'm not sure, but I would remove following lines:

  • lsm6dsl_sh_syncro_mode_set(&dev_ctx, LSM6DSL_EXT_ON_INT2_PIN);
  • lsm6dsl_fifo_write_trigger_set(&dev_ctx, LSM6DSL_TRG_SH_DRDY);

This setting is related to sensor hub.

RHube
Associate

If I remove those the buffer gets filled without a trigger signal. I think in this case the trigger is data ready signal (as default). Because off this I added the fifo write trigger function. After this I added the syncro mode to turn the INT2 pin to an input.

I tested today the example on page 28 of the application note. Doesn't work either. The FIFO doesn't get filled with this code.

It should be possible to use the trigger function without an external sensor?

Thank you.