Bosch Sensortec Community

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

    BHI160B BoschSensorHub library

    BHI160B BoschSensorHub library

    bgfas
    New Poster

    I am trying to bring up a board with a BHI160B. Is the library found at https://github.com/BoschSensortec/BoschSensorHub known to work for this sensor?

    The circuit involves a BHI160B with no attached secondary devices, should I be using the Bosch_PCB_7183_di03_BMI160-7183_di03.2.1.11696_170103.h firmware? The application only requires reading the accelerometer and gyroscope virtual sensors.

    26 REPLIES 26

    BSTRobin
    Community Moderator
    Community Moderator

    Hi bgfas,

    Could you give further feedback?

    BSTRobin
    Community Moderator
    Community Moderator

    Since there was no feedback for a long time, we close this topic first. You could update feedback in the future if you have.

    Apologies for the delay. What do you want me to capture with the logic analyzer?

    What follows is the bus activity for this line of code:

    bhi160.configVirtualSensor((bhyVirtualSensor)BHY_SID_ACCELEROMETER, false, BHY_FLUSH_ALL, 100, 0, 0, 0))

    i2c-1: Write
    i2c-1: Address write: 29
    i2c-1: Data write: 32
    i2c-1: Data write: FF
    i2c-1: Write
    i2c-1: Address write: 29
    i2c-1: Data write: 5C
    i2c-1: Data write: 64
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Data write: 00
    i2c-1: Write
    i2c-1: Address write: 29
    i2c-1: Data write: 54
    i2c-1: Data write: 03
    i2c-1: Write
    i2c-1: Address write: 29
    i2c-1: Data write: 64
    i2c-1: Data write: C1
    i2c-1: Write
    i2c-1: Address write: 29
    i2c-1: Data write: 3A
    i2c-1: Read
    i2c-1: Address read: 29
    i2c-1: Data read: C1

    If I'm understanding, the 0x32 0xFF is the FIFO flush, the write to 0x5C sets up a sensor configuration with 100 hz sampling rate followed by a pageselect (0x03 sensor page), request to write to non-wakeup accel (0xc1), and finally an ack (0x3a reports 0xc1).

    In this case the transfers all appeared correct (no nack occurred) however no sensor data was ever reported.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi bgfas,

    You can capture all I2C waveform after you pown on the device.

    With Saleae Logic tool, the waveform like this:

    I2C waveform.png

    The bus activitiy in the previous post was output from a logic analyzer.

    I've attached a longer logic analyzer capture log. I added delays (waits for serial input) between the following:

    - firmware upload

    - installing sensors

    - configuring sensors

    - checking sensor status

    - the final 'run loop' that should print out sensor values

    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