Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    [BMI160] can't receive LOW-G interrupt

    [BMI160] can't receive LOW-G interrupt

    potter1234
    New Poster

    Hi all,

    I'm using BMI160 with an MCU. The MCU is able to receive interrupts such as step counter and any-motion.

    However, I am not able to get LOW-G interrupt even though I adjusted parameters like low_dur & low_thres .

    In another platform (a different MCu) with the same settings I can easily generate LOW-G interrupt.

    My code is as follows. 

    Any feedback is appreciated.

    struct bmi160_int_settg int_config;

    /* Select the Interrupt channel/pin */
    int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1

    /* Select the Interrupt type */
    int_config.int_type = BMI160_ACC_LOW_G_INT;// Choosing LOW G/fall detection interrupt
    /* Select the interrupt channel/pin settings */
    int_config.int_pin_settg.output_en = BMI160_ENABLE;// Enabling interrupt pins to act as output pin
    int_config.int_pin_settg.output_mode = BMI160_DISABLE;// Choosing push-pull mode for interrupt pin
    int_config.int_pin_settg.output_type = BMI160_DISABLE;// Choosing active low output
    int_config.int_pin_settg.edge_ctrl = BMI160_ENABLE;// Choosing edge triggered output
    int_config.int_pin_settg.input_en = BMI160_DISABLE;// Disabling interrupt pin to act as input
    int_config.int_pin_settg.latch_dur = BMI160_LATCH_DUR_NONE;// non-latched output

    int_config.int_type_cfg.acc_low_g_int.low_data_src=BMI160_ENABLE;//
    int_config.int_type_cfg.acc_low_g_int.low_en = BMI160_ENABLE;//
    int_config.int_type_cfg.acc_low_g_int.low_mode = BMI160_ENABLE;//
    int_config.int_type_cfg.acc_low_g_int.low_hyst = BMI160_ENABLE;//
    int_config.int_type_cfg.acc_low_g_int.low_dur = acc_int.fd_fall_duration; // [ms] ((n+1) * 2.5) PREV=50
    int_config.int_type_cfg.acc_low_g_int.low_thres = acc_int.fd_fall_threshold; // [mg] (n * 7.81) PREV=96

    bmi160_set_int_config(&int_config, &vImec_gsensor); /* sensor is an instance of the structure bmi160_dev */

    8 REPLIES 8

    BSTRobin
    Community Moderator
    Community Moderator

    Hello ,

    "In another platform (a different MCu) with the same settings I can easily generate LOW-G interrupt.", which MCU platform you could get interrupt? Which MCU platform you couldn't get interrupt?

    If it is possible you could measure INT1 pin and check if sensor output HW interrupt signal.

    Hi,

    Ambiq micro (Apollo2) has no problem receiving interrupt. However Nordic 52840 never receives LOW-G interrupt.

    BSTRobin
    Community Moderator
    Community Moderator

    Hello potter1234,

    You could dump all BMI160 register value on Apollo2 and nrf52840 after SW initialization, and compare the difference. If Low-g related register values are same, you need to check nrf52840 driver and see how to enable receiving interrupt.

    Hi,

    After some more experiment I am able to receive low-g interrupt now. However, the interrupt bit I receives is always 0.

    My code as follows.

    union bmi160_int_status interrupt;
    enum bmi160_int_status_sel int_status_sel;

    /* Interrupt status selection to read all interrupts */
    int_status_sel = BMI160_INT_STATUS_ALL;
    int rslt = bmi160_get_int_status(int_status_sel, &interrupt, &sensor);

    when I print out interrupt.bit, it always gives 0. Isn't that weird coz  the table looks like this 

    struct bmi160_int_status_bits
    {
    #if LITTLE_ENDIAN == 1
    uint32_t step : 1;
    uint32_t sigmot : 1;
    uint32_t anym : 1;

    /* pmu trigger will be handled later */
    uint32_t pmu_trigger_reserved : 1;
    uint32_t d_tap : 1;
    uint32_t s_tap : 1;
    uint32_t orient : 1;
    uint32_t flat_int : 1;
    uint32_t reserved : 2;

     

    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