05-12-2023 10:41 PM
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:
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
Solved! Go to Solution.
05-15-2023 05:27 AM
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.