Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160 power mode switching

    BMX160 power mode switching

    VinceCristiano
    New Poster

    Hello!!

    my project is a wireless sensor network that wake-up every 10 minutes. At every wake-up, I read IMU data from bmx160 where all the sensors (acc, gyro and mag) are in normal power mode. During the sleep state, I would like to switch these power modes to suspend mode. Reading the datasheet, page 16 tab 8, I cannot perform a diagonal transition but only vertical or horizontal ones between accelerometer power modes and gyroscope power modes.  So, I act as follow:

    /* switch to normal mode (pwr) */
    /* Select the power mode */
    sensor.accel_cfg.power = BMX160_ACCEL_NORMAL_MODE;
    
    /*  Set the Power mode  */
    rslt = bmx160_set_power_mode(&sensor);
    
    sensor.gyro_cfg.power = BMX160_GYRO_NORMAL_MODE;
    
    /*  Set the Power mode  */
    rslt = bmx160_set_power_mode(&sensor);
    
    sensor.mag_cfg.power = BMX160_MAG_NORMAL_MODE;
    
    /*  Set the Power mode  */
    rslt = bmx160_set_power_mode(&sensor);

    and, after the acquisition, the opposite from normal to suspend mode. In this way, I get incorrect data or even all zeros. 
    I also tried to do this change all in one:

    sensor.accel_cfg.power = BMX160_ACCEL_NORMAL_MODE;
    sensor.gyro_cfg.power = BMX160_GYRO_NORMAL_MODE;
    sensor.mag_cfg.power = BMX160_MAG_NORMAL_MODE;
    
    rslt = bmx160_set_power_mode(&sensor);

    but I have the same problems as above.

    How can I perform this? 

    best regards,
    Vincenzo

    3 REPLIES 3

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    Afteryou set BMX160 accel, gyro and mag to normal mode, are you getting the correct data?

    After you set BMX160 accel, gyro and mag back to suspend mode, the sensors will not take any measurements. So you are supposed to get all zeros or the last measurements from these sensors' data registers because the data registers will not be updated any more. Please refer to BMI160 + BMM150 API source code examples online at https://github.com/BoschSensortec/BMI160_driver for more information.

    Thanks.

    Hi 

     

    sensor.accel_cfg.power = BMX160_ACCEL_NORMAL_MODE;
    sensor.gyro_cfg.power = BMX160_GYRO_NORMAL_MODE;
    
    /*  Set the Power mode  */
    rslt = bmx160_set_power_mode(&sensor);
    CPUdelay(970000);

     

     

    sensor.mag_cfg.power = BMX160_MAG_NORMAL_MODE;
    
    /*  Set the Power mode  */
    rslt = bmx160_set_power_mode(&sensor);

     

    Hi,

    On page 90 of BMX160 datasheet the typical and max delay time are defined when switching to normal mode for accel, gyro and mag. To be safe, you can add delay of 5ms for accel when switching from suspend mode to normal mode, 100ms for gyro and 2ms for mag.

    The reason why gyro needs longer delay time is gyro has internal oscillating MEMS structure to sense the Coriolis acceleration and it takes time for it to stabilize and get the ADC ready for measurement. If you read gyro data within the delay time, then you may get all zeros back because it is not ready yet. Same to accel and mag.

    Thanks.

    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