04-25-2023 11:56 AM
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?
Solved! Go to Solution.
05-05-2023 03:56 PM
HI,
After doing this i just have to call bhy2_get_product_id() in main function with all dependency library. Is that right? or any spi configuration needed.
05-10-2023 12:07 PM
Hi rajesh_s,
Did you run previous example code we provided?
We are not familiar with your host platform, make sure bhy2_spi_read(), bhy2_spi_write(), bst_delay_us() are implemented by host platform.
PDEBUG("Use SPI interface\r\n");
rslt = bhy2_init(BHY2_SPI_INTERFACE, bhy2_spi_read, bhy2_spi_write, bst_delay_us, BHY2_RD_WR_LEN, NULL, &bhy2);
Run into demo_sensor() function, it will call bhy2_get_product_id().
05-11-2023 12:09 PM - edited 05-11-2023 12:16 PM
Hi BSTRobin,
we are having a stm32f4 discovery board and we tried the example code that you provided since it is having multiple dependency library from coines we are mergin it, but my doubt is if i do i2c readWrite(0x1c) to bosch shuttle board by querying product id without any of your code or coines function i am getting the response as 0x89 then why using spi i could not able to do it.In spi we did connection based on data sheet and used mode 0 with proper cloak frequency.still we cannot able to do it.could you tell us why?(not working even with stm32f4). we want normal spi read write and get response from bosch shuttle board. could you try a normal spi read write with stm32f4 without coines and try to get response from bosch shuttle board. Because this condition helps us to make our project more progress since we are starting from scratch.
05-22-2023 04:52 AM
Hi rajesh_s,
Prevous example code run on STM32F401, has no dependency library from coines.
We confirmed previous example can run on STM32, you can check your host software code even you can't run example code on STM32.
For SPI/I2C communictaion timing with host, you can refer chapter 19.5 Timing Characteristics in BHI260AP data sheet.
07-16-2023 03:58 PM
Hi BSTRObin,
It's been a month still spi issue exist. i tried with your example code still i am getting 0xff. i am attaching my entire stm32 workspace project here please try the same on your side . With the same configuration other slaves are responding but not BHI260ap.
Steps followed:
1.bhi260ap shuttle board connected to stable 1.8v for vdd and vddio and ground connected.
2.using a level shifter MISO,MOSI,CS and SCK of bhi260ap 1.8v spi comm connected to 3.3v stm32f4 discovery SPI1(or SPI2) peripheral.
3.checked continuity on both sides.
4. Did a soft reset using command 0x14 and request product id using 0x9c (cmd 0x1c with mask for read 0x80) still getting 0xff.
5.tried with different spi config but i am mentioning one of them(spi mode: 0 ,spi clock speed 2mhz)
Once again i am attaching my schematics and spi configuration. please help us with this.
please note ATSAMD51 mcu is our original setup but also tried with stm32f4 same connection as mentioned in schematics and tested. still 0xff as response.