finani/ICM42688

Issue with SPI mode for mikroe-4237 board ( ICM42688-p )

jlja18 opened this issue · 2 comments

If you get an error in the simple SPI example on the very first read, change the SPI mode to mode3 in the source code.

It seems like the SPI mode should be set as SPI_MODE3 for all masters/boards. Looking at Section 9.6 of the datasheet, data is latched on the rising edge of SCLK, which is either MODE0 or MODE3. Looking at Section 3.5 of the datasheet shows that an inactive clock should be pulled high, which is either MODE2 or MODE3. Therefore, SPI_MODE3 is the appropriate choice.

image

See the following for more info on SPI modes: https://www.corelis.com/education/tutorials/spi-tutorial/

image

tested on esp32

Thank you for the issues and the reply.
I tested the repo with teensy 4.0. So, It would be a little different at other boards.