Bosch Sensortec Community

    SOLVED

    BMI160 IMU Accelerometer Data Not Changing (i.e "frozen")

    Highlighted
    New Poster

    BMI160 IMU Accelerometer Data Not Changing (i.e "frozen")

    Hi,

    I'm new to IMUs. We created code to initialize and use the BMI160 inertial measurement unit very similar to Bosch's driver offered in github.

    I can read gyroscope and magnetometer data, but the accelerometer data freezes most of the time. That is, it repeats the same, or very similar values, all the time.

    My code goes like this:

    0) Initialize the IMU and Magnetometer. All three sensors power mode set to normal. ACC_CONFIG = 0x28, ACC_RANGE = 0x03.

    1) Press a button on our device

    2) Start reading the DATA register every 10 ms, for 10 seconds, storing it in an array in RAM.

    3) After reading and storing the data, print it to our DEBUG serial output (i.e. printf)

    Result: 

    accel= -6298,1403,-3084,

    accel= -6298,1403,-3084,

    accel= -6298,1403,-3084,

    ... and so on. I verified that these data values are actually received in our I2C interface.

    Any ideas of what can cause the frozen data? 

    Thanks in advance.

    Tags (2)
    3 REPLIES 3
    Highlighted
    Community Moderator

    Re: BMI160 IMU Accelerometer Data Not Changing (i.e "frozen")

    Hi,

    Thank you for your message.

    After power on BMI160 accel and gyro will be in suspend mode by default waiting for your configuration. You can write value of 0x11 to command register 0x7E to bring accel to normal mode. You need to wait for at least 5ms and then you can write value of 0x15 to command register 0x7E to bring gyro to normal mode. You also need to wait at least 80ms for gyro to be stablized before you perform I2C read or write action. Then you can read register 0x03 to see if you get the value of 0x14 back. If yes, then it means both accel and gyro are in normal mode.

    Now you can read data registers from 0x12 to 0x17 6 bytes for accel data continuously. The accel data should not be frozen no matter if BMI160 is stationary or in motion. Maybe you read wrong registers which are constant or maybe the accel is still in suspend mode because you did not wait long enough after you write value of 0x11 to command register 0x7E. 

    Highlighted
    Occasional Visitor

    Re: BMI160 IMU Accelerometer Data Not Changing (i.e "frozen")

    Hi,

    I have a peculiar problem problem with your chip BMI160.After
    configuring it via I2c iam able to read the chip ID of 0x1d , but the chip
    does not go to normal mode and the accelerometer value always return zero. Can
    you provide some inputs , My code is attched below. Iam using nrf52 connected to
    BMI160 via pins 12 and 13 for I2c

    Highlighted
    Community Moderator
    Community Moderator

    Re: BMI160 IMU Accelerometer Data Not Changing (i.e "frozen")

    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