Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 Configuration and Data Processing

    BMI270 Configuration and Data Processing

    Butter
    New Poster

    Hi,

    I followed the BMI270 datasheet and configured the device in normal mode. This is the values in the relevent registers :

    • Register 0x40 = 0xA8
    • Register 0x41 = 0x00
    • Register 0x42 = 0xA9
    • Register 0x43 = 0x00
    • Register 0x7C = 0x02

    With this configuration, I'm able to get accelerometer data, but not gyroscope. Another problem I'm having is converting the raw data into m/s^2. I followed the BMI270-Sensor-API and this is the data processing that I'm doing :

     

     

    let gravity_earth = 9.80665 as f32;
    let half_scale = 32768.0;
    
    let accel_data_x = ((buffer[1] as u16) << 8 | (buffer[0] as u16);
    let accel_data_y = ((buffer[3] as u16) << 8 | (buffer[2] as u16);
    let accel_data_z = ((buffer[5] as u16) << 8 | (buffer[4] as u16);
    
    let accel_x = (gravity_earth * accel_data_x as f32 * 2.0) / half_scale;
    let accel_y = (gravity_earth * accel_data_y as f32 * 2.0) / half_scale;
    let accel_z = (gravity_earth * accel_data_z as f32 * 2.0) / half_scale;
    
    let gyro_data_x = ((buffer[7] as u16) << 8 | (buffer[6] as u16);
    let gyro_data_y = ((buffer[9] as u16) << 8 | (buffer[8] as u16);
    let gyro_data_z = ((buffer[11] as u16) << 8 | (buffer[10] as u16);
    
    let gyro_x = (2000.0 / half_scale) * gyro_data_x as f32;
    let gyro_y = (2000.0 / half_scale) * gyro_data_y as f32;
    let gyro_z = (2000.0 / half_scale) * gyro_data_z as f32;

     

     

     

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Butter,

    You need to configure 0x7D to enable accel and gyro sensor as can't get gyro data.

    Hi Robin,

    I forgot to mention it, I already set the register 0x7D to 0x06.

    Is anyone going to reply?

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Butter,

    If you haven't used the BMI270 sensor API & example code(https://github.com/boschsensortec/BMI270-Sensor-API) and the code you designed doesn't work, we suggest you use the sensor API first until it runs well, and then refer to the sensor API for your modifications.

    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