Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 Configuration and Data Processing

    BMI270 Configuration and Data Processing

    New Poster


    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

    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?

    Community Moderator
    Community Moderator

    Hi Butter,

    If you haven't used the BMI270 sensor API & example code( 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.