Bosch Sensortec Community

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

    BMA400 interrupt for single sample that exceeds threshold

    BMA400 interrupt for single sample that exceeds threshold

    krzysiek_td
    New Poster

    Hello,

    In our application, we would like to configure the accelerometer to hold pre-trigger information in FIFO (BMA400 must be configured in normal mode). If a single sample exceeds the pre-defined threshold we need to wake up the main uC and read the entire FIFO.  

    We thought that wake-up interrupt will be able to do this but it looks like it works low power mode only. We were considering generic interrupt but the datasheet states that "The data rate for the filter output must be 100Hz" which is too low in our application (at least 400 Hz is required).

    Is it possible to configure BMA400 to generate pin interrupt if a single sample exceeds the pre-defined threshold in normal mode, please?

    Kind regards,
    Krzysztof

    2 REPLIES 2

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    BMA400 Gen1 and Gen2 interrupts can select ACC_Filt1 or ACC_Filt2. If you choose ACC_Filt2, then it is fixed at 100Hz data samples for Gen1 and Gen2 interrupt engine. If you configure BMA400 ODR to ACC_Filt1 and select ACC_Filt1 as data source for Gen1 or Gen2, then the ODR becomes 400Hz. You can also select threshold and duration of 2.5ms which stands for one single sample.

    Here is the pseudo code for +/-4g full scale range, 104mg threshold, 400Hz ODR for both data and Gen1 interrupt, every time data source to see if the  difference between current sample and previous sample exceeds the threshold or not. If yes, then INT1 pin will have a pulse for the Gen1 interrupt.

    void init_BMA400(void)

    {

    // configure common control registers

                Write 0x02 to register 0x19;               // bring BMA400 to normal mode from sleep mode

                Write 0x4A to register 0x1A;              // set BMA400 to 400Hz ODR, +/-4g full scale range and 0 over sampling rate (OSR) meaning one single 

                                                                                      measurement without averaging. The current consumption is about 3.5uA

                Write 0x00 to register 0x1B;               // select acc_filt1 400Hz as source for data registers

     

    // configure generic interrupt 1 parameters

                Write 0xE8 to register 0x3F;              // enable X/Y/Z axis for interrupt evaluation. Gen1 interrupt engine data source is acc_filt1 which is 400Hz ODR or

                                                                                      2.5ms time interval. Every time from data source update and hysteresis 0mg

               Write 0x02 to register 0x40;               // select activity detection which means the interrupt will be generated when the sample is beyond the +/-

                                                                                      threshold zone. Select OR logic meaning that any axis can trigger the interrupt

                Write 0x0D to register 0x41;              // set inactivity threshold to 0x0D = 13LSBs = 13LSBs * 8mg/LSB = 104mg (can be fine-tuned)

                Write 0x00 to register 0x42;               // set MSB of Gen1 interrupt duration to 0x00

                Write 0x01 to register 0x43;              // set LSB of Gen1 interrupt duration to 0x01 = 1LSBs = 1 * 2.5ms =2.5ms (can be fine-tuned). This corresponds to

                                                                                      one single sample

    // configure interrupt registers

                Write 0x04 to register 0x1F;               // enable generic interrupt 1 (Gen1)

                Write 0x04 to register 0x21;               // route Gen1 interrupt signal to INT1 pin

                Write 0x22 to register 0x24;               // set INT1 pin and INT2 pin both to push-pull and active-high

    }

    Now when you tap the table that BMA400 is sitting on, BMA400 Gen1 will generate an interrupt on INT1 pin. It is very sensitive. You can fine tune the threshold and duration to reduce the sensitivity.

    Thanks.

    Hello FAE_CA1, 

    Thank you very much, I confirm that this works as you described. I think we were confused by the statement that filter output "must be" 100 Hz for generic interrupts.

    Kind regards,
    Krzysztof

    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