Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 unable to get Data Ready Interrupt

    BMI270 unable to get Data Ready Interrupt

    Dutch2
    New Poster

    I am using a BMI270 connected to an ESP32-S3 with I2C on a custom board. INT1 of the BMI270 is connected to IO8 on the ESP32.

    I'm initializing the BMI270 with the config file from https://github.com/boschsensortec/BMI270_SensorAPI/blob/master/bmi270.c

    I'm reading init_ok from INTERNAL_STATUS register (0x21) after initialization.

    Next I configure the accelerometer and gyroscope to 100Hz data rate and enable the interrupt:

        //Enable accelerometer, gyroscope, and temperature sensors, disable aux interface
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x7D, 0x0E);
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x40, 0xA8);
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x42, 0xA8); 
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x7C, 0x02);
        //Enable INT1 interrupt pin, map to data ready interrupt
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x53, 0x0C);
        i2c_write_register(I2C_NUM_1, BMI270_ADDR, 0x58, 0x04);

     When I read the accelerometer and gyroscope data once a second it seems to be correct when I move the board around.

    Reading the INT_STATUS_1 register, bit 6 & 7, gyroscope & accelerometer data ready interrupt bits are 1.

    However, I'm not getting any change on the INT1 pin. The ESP32 pin is configured as an input and when I enable the internal pull-up INT1 is high. When I disable the pull-up the pin is low, indicating that the BMI270 is not driving the INT1 pin.

    Any idea what I am doing wrong here? Any suggestions are greatly appreciated.

    Thanks.

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Dutch2,

    What feature(any motion, data ready, etc.) do you expect to use for BMI270 and output it to INT1?

    Right now I'm trying to get a Data Ready Interrupt.

    My ultimate goal is to feed the accelerometer and gyroscope data into a Kalman filter to get tilt information.

    Thanks.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Dutch2,

    https://github.com/boschsensortec/BMI270_SensorAPI/blob/master/bmi270_examples/accel_gyro/accel_gyro... has demonstrated the data ready interrupt for reading sensor data.
    You can refer to this example code and add the following code in set_accel_gyro_config() function.

    struct bmi2_int_pin_config int_cfg;

    bmi2_get_int_pin_config(&int_cfg, dev);

    int_cfg.pin_type = BMI2_INT1;
    int_cfg.pin_cfg[0].lvl = BMI2_INT_ACTIVE_HIGH;/*Config INT1 rising edge trigging*/
    int_cfg.pin_cfg[0].od = BMI2_INT_PUSH_PULL;
    int_cfg.pin_cfg[0].output_en= BMI2_INT_OUTPUT_ENABLE;

    bmi2_set_int_pin_config(&int_cfg, dev);
    bmi2_error_codes_print_result(rslt);

     

    Also ensure that your host IO is configured with interrupt mode and the correct triggering method.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist