Skip to main content
Associate III
December 18, 2023
Solved

not able to read WHO_AM_i Register value.

  • December 18, 2023
  • 2 replies
  • 1798 views

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.

 

Best answer by TDK

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.

 

2 replies

TDK
TDKBest answer
December 18, 2023

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""."
Rohit007Author
Associate III
December 20, 2023

Thank you so much it worked according to your suggestions.