Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMA400 interrupt pin mapping

    BMA400 interrupt pin mapping

    baukespoelstra
    New Poster

    Hello,

    I am trying to map my Activity change interrupt to a physical interrupt to trigger the host MCU. (nrf52805)

    I can succesfully read the interrupt with bma400_get_interrupt_status.

    My code for setting pin as output for the interrupt is as below:

        int_en.type = BMA400_ACTIVITY_CHANGE_INT_EN;
        int_en.conf = BMA400_ENABLE;

        rslt = bma400_enable_interrupt(&int_en, 1, &bma);
        bma400_check_rslt("bma400_enable_interrupt", rslt);

        dev_settings[0].type = BMA400_INT_PIN_CONF;
        dev_settings[0].param.int_conf.int_chan = BMA400_MAP_BOTH_INT_PINS;
        dev_settings[0].param.int_conf.pin_conf = BMA400_INT_PUSH_PULL_ACTIVE_0;

        rslt = bma400_set_device_conf(dev_settings, 1, &bma);
        bma400_check_rslt("bma400_set_device_conf", rslt);
     
    Also attached it. I can not get it working with the physycal pin. Am i missing something?
    I am measuring with an oscilloscope.
     
     
    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi baukespoelstra,

    You could add this line of code and check if INT1 pin output interrupt signal.
    accel_settin[0].param.act_ch.int_chan = BMA400_INT_CHANNEL_1;

    Hi,

    This was already in the code i attached.

        accel_settin[0].type = BMA400_ACTIVITY_CHANGE_INT;
        accel_settin[1].type = BMA400_ACCEL;
    
        rslt = bma400_get_sensor_conf(accel_settin, 2, &bma);
        bma400_check_rslt("bma400_get_sensor_conf", rslt);
    
        accel_settin[0].param.act_ch.int_chan = BMA400_INT_CHANNEL_1;
        accel_settin[0].param.act_ch.axes_sel = BMA400_AXIS_XYZ_EN;
        accel_settin[0].param.act_ch.act_ch_ntps = BMA400_ACT_CH_SAMPLE_CNT_64;
        accel_settin[0].param.act_ch.data_source = BMA400_DATA_SRC_ACC_FILT1;
        accel_settin[0].param.act_ch.act_ch_thres = 10;
    
        accel_settin[1].param.accel.odr = BMA400_ODR_100HZ;
        accel_settin[1].param.accel.range = BMA400_RANGE_2G;
        accel_settin[1].param.accel.data_src=BMA400_DATA_SRC_ACCEL_FILT_1;
    
        /* Set the desired configurations to the sensor */
        rslt = bma400_set_sensor_conf(accel_settin, 2, &bma);
        bma400_check_rslt("bma400_set_sensor_conf", rslt);

     

    Update:

    It turns out the INT pins are swapped on the MIKROE-3149 BMA400 evkit.

    If I set INT1, I can measure at INT2. Checked with the datasheet, the pins are changed.

    Hi baukespoelstra,

    You could refer the example code in your other topic: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/Inactivity-detection-with-BMA400/td-p/58...

    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