2018-06-26 09:17 AM
After properly setting up i2c with my choice MCU, INT1 is never fired. (I have tested with logic analyzer and INT1 pin is always low, and its configured as active high)
lsm303agr_xl_block_data_update_set(&dev_ctx_xl, PROPERTY_ENABLE);
lsm303agr_xl_data_rate_set(&dev_ctx_xl, LSM303AGR_XL_ODR_10Hz);lsm303agr_xl_full_scale_set(&dev_ctx_xl, LSM303AGR_2g);lsm303agr_xl_operating_mode_set(&dev_ctx_xl, LSM303AGR_LP_8bit);lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG1_A, (uint8_t*) 0x97, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG3_A, (uint8_t*) 0x60, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG6_A, (uint8_t*) 0x02, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG5_A, (uint8_t*) 0x00, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_CFG_A, (uint8_t*) 0x2A, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_THS_A, (uint8_t*) 0x64, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_DURATION_A, (uint8_t*) 0x01, 1);lsm303agr_xl_high_pass_int_conf_set(&dev_ctx_xl, LSM303AGR_DISC_FROM_INT_GENERATOR);
With ST standard C drivers, I can set up registers and read back checking it have the correct values.
So my question is, There is any workflow diagram on how to properly set up INT1 after a threshold in movements?
I have tested all possible combinations on interrupt sources (AOI, X/Y/Z Higher than, X/Y/Z lower than...) and INT1 is always low. Interrupts are enabled and not latched. No filter, high frequency filter set, threshold set/ not set....
I am not reading the discrete values of XL or MAG axis, only trying to interrupt, so its possible the LSM303AGR is in some low power and not firing it up if I dont read the axis values? Can it be a wrong set up of high frequency filter to eliminate gravity and static accelerations??
I have tested at this point a A LOT of configurations without any result. At las instance, do you guys have any working piece of code with registers configuration that make INT1 interrupt fire, just to debug and trying to figure what I am doing wrong.
Thanks a lot!!
2018-06-26 09:48 AM
lsm303agr_xl_block_data_update_set(&dev_ctx_xl, PROPERTY_ENABLE);
lsm303agr_xl_data_rate_set(&dev_ctx_xl, LSM303AGR_XL_ODR_10Hz);lsm303agr_xl_full_scale_set(&dev_ctx_xl, LSM303AGR_2g);lsm303agr_xl_operating_mode_set(&dev_ctx_xl, LSM303AGR_LP_8bit);lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG1_A, (uint8_t*) 0x97, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG3_A, (uint8_t*) 0x60, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG6_A, (uint8_t*) 0x02, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_CTRL_REG5_A, (uint8_t*) 0x00, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_CFG_A, (uint8_t*) 0x2A, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_THS_A, (uint8_t*) 0x64, 1); lsm303agr_write_reg(&dev_ctx_xl, LSM303AGR_INT1_DURATION_A, (uint8_t*) 0x01, 1);lsm303agr_xl_high_pass_int_conf_set(&dev_ctx_xl, LSM303AGR_DISC_FROM_INT_GENERATOR);
For example the configuration above does not work
2018-07-09 08:11 AM
Even if I don't know why you mix the high level function with direct register access, you configuration seems OK to me.
I'm able to get the interrupt from the device with you configuration, if I share with the board.
Is your INT pin connected to a MCU? If so is the GPIO configured as input? Are you sure that MCU or other device don't force the line low?
2018-07-10 03:17 AM
It is possible to use the Unico GUI with x-NUCLEO-IKS01A2?? that options seem very handy to debug the register configuration.
Thank you is working now, for some reason the high pass filter was disabled and the interrupt was triggered forever so the MCU was not counting interrupts.
2018-07-13 04:17 AM
Unfortunately not Unico GUI doesn't support X-NUCLEO-IKS01A2.
You can use
with software package but the so far the sensor configuration features are limited.