Bosch Sensortec Community

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

    BMI160 switching to SPI

    BMI160 switching to SPI

    cobrul
    New Poster

    The datasheet says on page 89 (chapter 3.2.1 - Primary interface i2c/spi protocol selection) that a rising edge on CS is needed to switch to SPI:

    "At reset / power-up, BMI160 is in I2C mode. If CSB isconnected to VDDIOduring power-up and not changed the sensor interface works in I2C mode.For using I2C, it is recommended to hard-wire the CSB line to VDDIO. Since power-on-reset is only executed when,both VDDand VDDIOare established, there is no risk of incorrect protocol detection due to power-up sequence.If CSB sees a rising edge after power-up, the BMI160 interface switches to SPI until a reset or the next power-up occurs.Therefore, a CSB rising edge is needed before starting the SPI communication"

    Is there a time limit for this or it will automatically switch to SPI even if the cs low/high edge comes later (let's say 1ms) after power up ?

    I have a board where the main cpu and the sensor are powered from a battery and I have the sensor wired to us SPI, is it enough to just do a dummy write (as the datasheets says) right after boot to trigger the switch to SPI or should I redesign the board so that the cpu controls the sensor's VDD pin
    Currently I am doing a dummy SPI read from 0x7e right after boot, then I can read the chip id and it has a correct value, but I was wondering if this may glitch from time to time or is it safe to keep as it is?

    I saw this as an example (but would require me redesign the board):  set CS low, turn on sensor (apply power to VDD), set CS high.

    Thank you.

    1 REPLY 1

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    You don't need to redesign your board to follow that example and it is safe for you to keep the way you are doing.

    After BMI160 os powered on, it will take less than 10ms to finish the POR (power-on-reset at page 13 of BMI160 datasheet). Then BMI160 will be in suspend mode with default I2C interface. Now you can do a dummy read at any register for example 0x7E or 0x7F or 0x00, etc. through SPI interface. BMI160 will automatically switch to SPI interface. If there is no soft-reset or another POR during operation, then BMI160 will always stay in SPI interface.

    By the way, BMI160 has been discontinued. Please switch to BMI270 which is pin-to-pin compatible with BMI160.

    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