Bosch Sensortec Community

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

    BMI088 Accelerometer read "feature"

    dl1uj
    New Poster

    BMI088 Accelerometer read "feature"

    Hello,

    I started to write a very small driver for the BMI088. While the gyroscope is working like expected, The accelerometer has a stange “feature”. Writing to it works fine, but reading any register gives the value of the previous read request. To read the xyz values I have to write twice to the register 0x12 to get the proper axis values like this:

    ACC_ENABLE();

    spi_transfer(ACC_X_LSB_12 | 0x80); // Start register read

    spi_transfer(ACC_X_LSB_12 | 0x80); // Again start register read (why ever!)

    ax = spi_transfer(0xFF);   ax += spi_transfer(0xFF) << 8;

    ay = spi_transfer(0xFF);   ay += spi_transfer(0xFF) << 8;

    az = spi_transfer(0xFF);   az += spi_transfer(0xFF) << 8;

    ACC_DISABLE();

    With this workaround the raw values for the IMU are fine. Does anyone know why the reading result is shifted by one operation? Looks like it´s caused by the FIFO, but I don´t write anything to it. Any help is welcome. Doing almost the same with the BMI055 worked without any problems.

    Greetings from Germany

    Udo

     

    3 REPLIES 3
    Vincent
    Community Moderator

    Re: BMI088 Accelerometer read "feature"

    For BMI088 accel,  the default interface is configged as I2C,  you need a dummy read of SPI to switch to SPI bus first. 

    Also you need a dummy byte during SPI read from the accel part.

    You can refer to our BMI088 API on Github from following link:

    https://github.com/BoschSensortec/BMI08x-Sensor-API

     

    gigamonte
    New Poster

    Re: BMI088 Accelerometer read "feature"

    When selecting SPI for BMI088 accelerometer, does the datasheet indicate that the user has an option between toggling the PS pin and sending a dummy read or do both need to be done? It's not clear.

     

    Minhwan
    Community Moderator

    Re: BMI088 Accelerometer read "feature"

    Hello gigamonte, 

     

    SPI CS pin and dummy data for BMI088 are necessary. 

    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