Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    [BMI160] Register values always zero

    [BMI160] Register values always zero

    potter1234
    New Poster

    Hi all,

    I encountered a strange issue in BMI160 with nordic 52840 mcu. (on a customed board)

    The situation looks like this:

    1.The mcu has no problem receving irq like STEP_DETECT_INT, DOUBLE_TAP_INT, and the register values of 0x1C-0x1F are correctly displayed.

    2. However, when I try to set irqs like LOW_G_INT, HiGH_G_INT, SLOW_NO_MOTION_INT, I can see irqs arriving in my interrupt handler, but the register values of 0x1C-0x1F are always zero.

    This can be quite problematic, since I have no clue which interrups are triggered.

    for setting low-g interrupt, my code looks like this

    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 = low_dur; // [ms] ((n+1) * 2.5) PREV=50
    int_config.int_type_cfg.acc_low_g_int.low_thres = low_thres; // [mg] (n * 7.81) PREV=96

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

    I'm pretty sure I followed every guideline from here https://github.com/BoschSensortec/BMI160_driver

    What could possibly be wrong here?  Is it possible that it has something to do with HW schematic?

    Any feedback will be appreciated.

    Thank you!

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hello potter1234,

    There was another ticket that had same TAP feature usage with you.
    You could refer this ticket.
    https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/bmi160-tap-detection/td-p/21749

    What I've been struggling has nothing to do with tap at all.

    My question is I can see LOW_G_INT, HiGH_G_INT, SLOW_NO_MOTION_INT,  irqs firing, but the register values of 0x1C-0x1F are always zero.

    In this case, I can't tell which interrupt is actually firing and I really need to distinguish them.

    BSTRobin
    Community Moderator
    Community Moderator

    Hello potter1234,

    It was a reference code that run well. When MCU received HW interrupt signal, then read non-zero 0x1C-0x1F register values. For your reference to compare with you code.

     

    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