OpenIMU 330BI EVK SPI 通信异常

主控:STM32F429
IMU:openimu330BI
SPI
频率:1MHz
mode: 1 1
问题描述:
将stm32f429作为SPI master, 使用SPI传输数据时,只能成功1次,后面读取的MISO数据全为0
eg:
MOSI : 56 00 00 00 56 00 00 00
MISO :00 00 33 00 00 00 00 00
CS是从一开始拉低一直到传输结束后才拉高,想请问下这个原因的可能地方在哪?谢谢

@Linuxer
pls refer to SPI description, the working process of single read is: b810514e-3774-4be8-a7da-8957d1c963d4-image.png
and you also need wait more than 16us after request command, such as: 56 00 request, and 20 us later receive the feedback.d6350c02-0df5-4212-a8c2-3b46cb3aea00-image.png

@cek I try to delay 1ms between request command and receive feedback, but has the same feedback : 0x00 0x00
test.png 264bab7b-7003-4494-ae1c-c1a52870bbc7-image.png

Thanks !@cek
cs should be low in read operation,problem has solved

You are welcome.
Reminder for IMU330/300 SPI users: from SPI part in online manual

  • configurations: IMU working in SPI mode; SPI mode 3(CPOL = 1 (polarity) and CPHA = 1 (phase)); Data is transmitted 16-bits words, Most Significant Bit (MSB) first;
  • read and write register sequence:
    184e7289-ab99-45ba-8453-518764b0ed93-image.png
    fb5808a2-291c-4114-bfd3-74f73fe1ba3e-image.png
  • Follow the timing applies at system startup:
    175be2af-b547-490c-a465-19ca2341fd78-image.png
Log in to reply