02-19-2022 06:34 PM
Hi,
I migrated my application from BMI160 to BMI270 and I am having a few issues. Flat detect interrupt for example is not working as in BMI160. It used to trigger only when the gravity is on the z-axis. On BMI270, it's triggering in all orientation.
I tried to play with the settings but I can't get the behaviour I want.
Can you please help me understand how to configure this feature on the BMI270?
Thank you
02-20-2022 04:18 AM
Hello Katie2020,
Did you use BMI270 github software(https://github.com/BoschSensortec/BMI270-Sensor-API) or other software version?
02-20-2022 10:22 AM
Hi
Yes I am using the code from GitHub
Thanks
02-20-2022 12:49 PM
Hi Bsoch Sensortec Community
I've done more testing/invetigation today and I found the following:
struct bmi2_sens_int_config sens_int = {.type = BMI2_FLAT, .hw_int_pin = BMI2_INT1};
/* Get default configurations for the type of feature selected. */
struct bmi2_sens_config config;
config.type = BMI2_FLAT;
config.cfg.flat.hold_time = 1;
config.cfg.flat.theta = 0x33;
config.cfg.flat.hysteresis = 1;
config.cfg.flat.blocking = 0;
rslt = bmi270_legacy_set_sensor_config(&config, 1, &ss_sens);
bmi2_error_codes_print_result(rslt);
rslt = bmi270_legacy_get_sensor_config(&config, 1, &ss_sens);
bmi2_error_codes_print_result(rslt);
rslt = bmi270_legacy_map_feat_int(&sens_int, 1, &ss_sens);
bmi2_error_codes_print_result(rslt);
uint16_t int_status;
int8_t rslt;
rslt = bmi2_get_int_status(&int_status, &ss_sens); // int_status is always equal to 8
Am I missing something? With BMI160, I can enable one interrupt at the time with no issue. Also interrupt status reports the correct interrupt using:
bmi160_get_int_status(BMI160_INT_STATUS_ALL, &int_status, &ss_sens);
Can't we get all interrupts status on BMI270 at all?
Thank you
02-22-2022 04:02 AM
Hello Katie2020,
Did you have interrupt pin connected to host MCU on your hardware board?
If you have, you could modify the code to read the sensor status register in the interrupt mode. After receiving the interrupt signal, read the value of the interrupt status register to see if it is correct value?