Bosch Sensortec Community

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

    Unable to read ChipID of BMI323 through spi using TI TM4C123GXL

    Unable to read ChipID of BMI323 through spi using TI TM4C123GXL

    Naren
    New Poster

    I am trying to interface BMI323 IMU with TM4C123GXL microcontroller using SPI. 

    For first stage, I thought of trying something simple like reading the chipID, but i am unable to get a response from the imu.

    I have connected VDD and VDDIO to 3.3V from mcu dev board.

    First i am writing 0x80 (as 0x00 is the address and 8th bit is high for read operation) and the writing 0x00 3 more times expecting a response from the IMU. Next,  I am reading the data from the receive buffer which should contain the chip ID.

    Naren_0-1699365845428.png

    This is the data I am writing to the SDI pin of the IMU (blue - clock, red - data out of mcu)

    Naren_2-1699367498580.png

    This is the data I am receiving from the SDO pin of IMU (blue - clock, red - data out of imu)

    Naren_3-1699367769679.png

    This is the output of chip select for reference with the clock (blue - clock, red - chip select)

    Is there anythig I am currently implimenting incorrectly

    2 REPLIES 2

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Naren,

    Firstly make sure your hardware was correctly connected.
    If possible, you can capture all SPI signal(CS, SCK, SDI, SDO) in one picture.
    For clock polarity and phase, it is necessary to ensure that the settings in the data sheet are followed:

    2023-11-08_10h39_53.png
    And software should strictly references the example code on Github https://github.com/boschsensortec/BMI323-Sensor-API

    Sorry for the delayed response.

    I was trying out all the combinations. I found out why I wasn't getting a response from the IMU. In the default write command(SSIDataPut) in SPI library(ssi.h) for TM4C123GXL writing multiple bytes was not a option so, I was writing in a for loop. But, with multiple write commands the Chip select would be pulled high after every byte instead of after all the bytes which the BMI323 expects. 

    This is the output of chip select with reference to clock (blue - clock, red - chip select)-Naren_3-1699367769679.png

    So, to work around this, I connected a GPIO pin to Chip select and toggle it before and after transmission of all the bytes.

    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