Bosch Sensortec Community

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

    BMA400 Current Consumption

    adrianwongCPI
    New Poster

    BMA400 Current Consumption

    Hi,

    I currently have a set up that will wake up external MCU using BMA400 auto-wakeup from low power, meaning the accelerometer should be set to low current consumption generally unless woken up. However when measuring current consumption of the device, I see a +400uA increase when the accelerometer when fully initialised and set up when it should only increase by ~1uA according to the datasheet. 

    Am I doing something wrong in the initialisation software that is causing this issue? (please note that when reading the register, it is telling me it is in low power mode)

    // Function initialises the BMA400 sensor
    bool init_bma400(struct bma400_dev *bma, struct bma400_sensor_conf *conf) {
    int8_t rslt;

    /* Set the sensor interface */
    if (set_interface(BMA400_I2C_INTF, bma)) {

    /* Initialise the BMA400 accelerometer */
    rslt = bma400_init(bma);
    if (rslt == BMA400_OK) {

    /* Soft reset the device */
    rslt = bma400_soft_reset(bma);
    if (rslt == BMA400_OK) {

    /* Select the type of configuration to be modified */
    conf->type = BMA400_ACCEL;

    /* Get the accelerometer configurations which are set in the sensor */
    rslt = bma400_get_sensor_conf(conf, 1, bma);
    if (rslt == BMA400_OK) {

    /* Modify the desired configurations as per macros available in bma400_defs.h file */
    conf->param.accel.odr = BMA_DATA_RATE;
    conf->param.accel.range = BMA_ACCL_RANGE;
    conf->param.accel.data_src=BMA_DATA_SOURCE;

    /* Set the desired configurations to the sensor */
    rslt = bma400_set_sensor_conf(conf, 1, bma);
    if (rslt == BMA400_OK) {

    /* Set the desired power mode to the sensor */
    rslt = bma400_set_power_mode(BMA400_LOW_POWER_MODE, bma);
    if (rslt == BMA400_OK) {
    return true;
    }
    else {
    return false;
    }
    }
    else {
    return false;
    }
    }
    else {
    return false;
    }
    }
    else {
    return false;
    }
    }
    else {
    return false;
    }
    }
    else {
    return false;
    }
    }

    3 REPLIES 3
    BSTRobin
    Community Moderator

    Re: BMA400 Current Consumption

    Hello adrianwongCPI,

    You mentioned "wake up external MCU using BMA400 auto-wakeup from low power", do you mean you will use BMA400 interrupt signal to wake up MCU? If yes, could you give out schematic or describe your HW connection?

    adrianwongCPI
    New Poster

    Re: BMA400 Current Consumption

    Screenshot_3.png

    Screenshot_1.png

      Yes I will be using the BMA400 interrupt signal to wake up the BL652. Hope the attached images help

    BSTRobin
    Community Moderator

    Re: BMA400 Current Consumption

    Hello adrianwongCPI,

    In your application code, there was no configuration code for BMA400 auto wakeup. You could refer the following BMA400 auto wakeup code, it run on STM32. Auto wakeup interrupt was mapped to INT1.

    main()

    {

    ...//Initialize BMA400

    Open_BMA400_Auto_Wakeup(dev);
    Config_BMA400_INT1(dev);
    Enable_MCU_INT1_Pin();

    bma400_set_power_mode(BMA400_MODE_LOW_POWER, dev);

    ...

    }

    int8_t Open_BMA400_Auto_Wakeup(struct bma400_dev *dev)
    {
    int16_t rslt = BMA400_OK;
    struct bma400_device_conf dev_conf;
    struct bma400_int_enable int_en;

    dev_conf.type = BMA400_AUTOWAKEUP_INT;
    dev_conf.param.wakeup.wakeup_ref_update = BMA400_UPDATE_EVERY_TIME;
    dev_conf.param.wakeup.sample_count = BMA400_SAMPLE_COUNT_1;
    dev_conf.param.wakeup.wakeup_axes_en = BMA400_AXIS_XYZ_EN;
    dev_conf.param.wakeup.int_wkup_threshold = 4;//63mg----2g range
    dev_conf.param.wakeup.int_chan = BMA400_INT_CHANNEL_1;

    rslt = bma400_set_device_conf(&dev_conf, 1, dev);
    if(rslt != BMA400_OK)
    {
    PDEBUG("bma400_set_device_conf set BMA400_AUTOWAKEUP_INT failed\r\n");
    }

    int_en.type = BMA400_AUTO_WAKEUP_EN;
    int_en.conf = BMA400_ENABLE;

    rslt = bma400_enable_interrupt(&int_en, 1, dev);
    if(rslt != BMA400_OK)
    {
    PDEBUG("bma400_enable_interrupt set BMA400_AUTO_WAKEUP_EN failed\r\n");
    }

    return rslt;
    }

    int8_t Config_BMA400_INT1(struct bma400_dev *dev)
    {
    int16_t rslt = BMA400_OK;
    struct bma400_device_conf dev_conf;

    dev_conf.type = BMA400_INT_PIN_CONF;
    dev_conf.param.int_conf.int_chan = BMA400_INT_CHANNEL_1;
    dev_conf.param.int_conf.pin_conf = BMA400_INT_PUSH_PULL_ACTIVE_1;

    rslt = bma400_set_device_conf(&dev_conf, 1, dev);
    if(rslt != BMA400_OK)
    {
    PDEBUG("Config_BMA400_INT1 bma400_set_device_conf set BMA400_INT_PIN_CONF failed\r\n");
    }

    return rslt;
    }

    void Enable_MCU_INT1_Pin(void)
    {
    GPIO_InitTypeDef GPIO_InitStruct = {0};

    __HAL_RCC_GPIOA_CLK_ENABLE();

    /*Configure GPIO pin : INT1_Pin */
    GPIO_InitStruct.Pin = INT1_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(INT1_GPIO_Port, &GPIO_InitStruct);

    /* EXTI interrupt init*/
    HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0);
    HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
    }

    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