Bosch Sensortec Community

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

    BMI270 with PSOC6

    BMI270 with PSOC6

    victorheca01
    Established Member

    Hi, Friend,

         my project used BMI270 with PSOC6, PSOc6 as master. I have 2 questions:

        1. during initialization, reading Chip ID, sometimes return 0x24, sometimes return other result. I found that when I program PSOC6, reset it and read chip ID, most likely I can get 0x24. However, I read Chip ID again and it will return random data. Could anyone explain to me if I repeatedly read Chip ID after reset, can it always return same data of 0x24?

    2. my code is simple as:

    txBuffer[0] = 0x80;
    txBuffer[1] = 0xff;
    txBuffer[2] = 0xff;
    txBuffer[3] = 0xff;
     
    rdBuffer[0] = 0x77;
    rdBuffer[1] = 0x77;
    rdBuffer[2] = 0x77;
    rdBuffer[3] = 0x77;

    Cy_GPIO_Clr(IMU_PORT, IMU_SPI_CS);

    Cy_SCB_SPI_WriteArray(SCB4, txBuffer, 2);
    while (!Cy_SCB_SPI_IsTxComplete(SCB4))
    {
    }

    /* Blocking wait for transfer completion */
    Cy_SCB_ReadArray(SCB4, rdBuffer, 2);

    Cy_GPIO_Set(IMU_PORT, IMU_SPI_CS);

    BMI270 spec mentioned that if read back 1 byte, should send 2 bytes on MOSI and the read results should be:

    0xff, 0x24, right? however, my read result is 0x24, 0x22 etc. 

    Many thanks to your help.

    Victor

    1 REPLY 1

    BSTRobin
    Community Moderator
    Community Moderator

    Hi victorheca01,

    1: It is recommended that you check the hardware it is correct, and use the official sensor API and example code as this is passed verify.
    2: When reading chip ID from BMI270 via SPI interface, sends one byte and reads two bytes, the first byte is the dummy byte and the second byte is the chip ID.

    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