cancel
Showing results for 
Search instead for 
Did you mean: 

not able to read WHO_AM_i Register value.

Rohit007
Associate III

i am using IMU ICM-42688-P sensor communicating with stm32 GOB1CET6N board using spi protocol. but, i am not able to read WHO_AM_I Value for more than 2MHz frequency. i have tried all settings but nothing is working. datasheet of sensor says SPI works on upto 24 MHz frequency.

i have given my main.c file in attachments.

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Make sure your pins are initialized in high frequency mode. This will be done within the HAL_SPI_MspInit function.

    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

If that doesn't help, you may just be running into signal integrity issues. Long jumper wires are going to top out in the MHz range. You can shorten the wires to try to help.

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Make sure your pins are initialized in high frequency mode. This will be done within the HAL_SPI_MspInit function.

    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

If that doesn't help, you may just be running into signal integrity issues. Long jumper wires are going to top out in the MHz range. You can shorten the wires to try to help.

 

If you feel a post has answered your question, please click "Accept as Solution".
Rohit007
Associate III

Thank you so much it worked according to your suggestions.