Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BMX160 : no FIFO watermark interrupt + fifo streaming question

    BMX160 : no FIFO watermark interrupt + fifo streaming question

    André
    Established Member

    I am using the code below to generate fifo watermark interrupts but I don't see any watermark interrupts generated. What am I doing wrong?

    (Sorry for the bad make up but I dont see an option to add a code )

     

     

    int8_t Open_BMI160_FIFO(struct bmi160_dev *dev)
    {
    int8_t rslt = BMI160_OK;
    struct bmi160_int_settg int_config;

    fifo_frame.data = fifo_buff;
    fifo_frame.length = 1024;
    dev->fifo = &fifo_frame;

    /* Clear FIFO configuration register */
    rslt = bmi160_set_fifo_config(BMI160_FIFO_CONFIG_1_MASK, BMI160_DISABLE, dev);
    if (rslt != BMI160_OK)
    {
    PDEBUG("Clear FIFO configuration register error, error code: %d\r\n", rslt);
    return rslt;
    }


    rslt = bmi160_set_fifo_wm(43, dev);//7*50=350 bytes, water mark value was word unit, cann't be greater than 255, 87*4=348
    if(rslt != BMI160_OK)
    {
    PDEBUG("bmi160_set_fifo_wm error, error code: %d\r\n", rslt);
    }
    // BMI160_FIFO_A_ENABLE enable fifo for accelerometer only
    rslt = bmi160_set_fifo_config(/*BMI160_FIFO_A_ENABLE |BMI160_FIFO_TAG_INT1 */
    BMI160_FIFO_ACCEL|BMI160_FIFO_HEADER, BMI160_ENABLE, dev);
    if(rslt != BMI160_OK)
    {
    PDEBUG("bmi160_set_fifo_config error, error code: %d\r\n", rslt);
    }

    /* Flush FIFO */
    rslt = bmi160_set_fifo_flush(dev);
    if (rslt != BMI160_OK)
    {
    PDEBUG("Flush FIFO error, error code: %d\r\n", rslt);
    return rslt;
    }

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

    /* Select the Interrupt type */
    int_config.int_type = BMI160_ACC_GYRO_FIFO_WATERMARK_INT;// Choosing 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 high output
    int_config.int_pin_settg.edge_ctrl = BMI160_DISABLE;// Choosing edge triggered output
    int_config.int_pin_settg.input_en = BMI160_DISABLE;// Disabling interrupt pin to act as input
    int_config.fifo_wtm_int_en = BMI160_ENABLE;//Enable FIFO watermark interrupt

    /* Set the FIFO watermark interrupt */
    bmi160_set_int_config(&int_config, dev);

    return rslt;
    }

    2 REPLIES 2

    BSTRobin
    Community Moderator
    Community Moderator

    Hi André,

    1.What is ODR you used?
    2.How long do you want to get watermark interrupt?
    3.Has the interrupt pin on the host side was connected to INT1 and been initialized?

    André
    Established Member

     

    I fixed it, cause was a to low watermark at an ODR of 1600Hz.  😕

     

    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