Bosch Sensortec Community

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

    SPI interface with bhi260ap and ATSAMD51 MCU

    SPI interface with bhi260ap and ATSAMD51 MCU

    rajesh_s
    Established Member

    Hi,

    I am using bhi260ap IMU for my project from command line as well as low level interface i can able to communicate with imu via I2C, but if i try to do the same with SPI i couldn't able to do it with either way.please help me with this issue.

    Steps followed:

    1.Directly connected IMU sensor with MCU which is having 1.8V as supply and communication voltage(Not working).
    2.Using a level shifter, connected 3.3V supply MCU to IMU. connected MISO,MOSI,SCK,SS and VDD,VDDIO(1.8V given) and ground connected(Not working).

    NOTE: Above two steps are working fine with I2C interface with their respective connections.

    We have gone through the entire Datasheet and still this issue persisit. Is there any other connection required for SPI?

    14 REPLIES 14

    BSTRobin
    Community Moderator
    Community Moderator

    Hi rajesh_s,

    1.There is no affect for SPI communicatoin that HOST_BOOT was connected to GND;

    2.See it from you schematic, you used BHI260AP shuttle 3.0 board, is it right?

    2023-05-04_16h39_16.png

    3.You could execut the code bhy2_get_product_id() and capture SPI waveform and check how about the actual SPI communication.

     

     

    rajesh_s
    Established Member

    Hi BSTRobin,
    yes we are using BHI260AP shuttle 3.0 board. Are you saying this function (bhy2_get_product_id()) from coines API?

    because in SDK that function is not present. In that case, can i call that function directly from my mcu with all dependency libraries?

    Our main objective is to establish communication between BHI260AP shuttle 3.0 board and atsamd51 mcu using spi protocol,without using application board 2.0

    BSTRobin
    Community Moderator
    Community Moderator

    Hi rajesh_s,

    This function bhy2_get_product_id() was from in BHI260AP sensor API(https://github.com/boschsensortec/BHY2-Sensor-API), you could call this function on host MCU side.
    BHI260AP software(sensor API and example code) was officially released on github https://github.com/boschsensortec/BHY2-Sensor-API, you could migrate it to your platform.
    I upload BHI260AP example code on STM32 that was not run with applicaiton board, you could also refer it.

    rajesh_s
    Established Member

    Hi BSTRobin,
    Thanks for the reply.

    We have already tried this with stm32 board using I2C it is working fine but not SPI. could you share us an example testing code for SPI communication...

    we used the same bhy2_get_product_id() function if you can provide the same using SPI it will be easy to debug for us.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi rajesh_s,

    Previous attached example code on STM32 demostrated SPI communication, you could see the macro definition in the file user_define.h
    //#define USE_I2C_INTERFACE
    #define USE_SPI_INTERFACE

    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