2018-11-07 07:05 AM
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);
2018-11-08 02:07 AM
I'm not sure, but I would remove following lines:
This setting is related to sensor hub.
2018-11-08 10:32 AM
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.