This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI clock issue

Hi,

I'm trying to use the SPI example from the SDK 11 to comunicate with a MPU accelerometer. The first time it works well, but then the clock send only 8 peak, so the slave can't answer.

Once 16 peak, once 8. Again and again

I don't understand this behaviour, if someone had any clue that would be great !

thanks

Arthur

Parents
  • I ran into the same problem. I think that the used interface is misleading (it suggests that rx lengths and tx lengths are independent). The best thing you can do is have your tx length and rx length the same. So if your command is 1 byte long and you are reading 2 bytes, make your tx and rx array 3 long. The command should be at tx[0]; the response will be available at rx[1] and rx[2].

Reply
  • I ran into the same problem. I think that the used interface is misleading (it suggests that rx lengths and tx lengths are independent). The best thing you can do is have your tx length and rx length the same. So if your command is 1 byte long and you are reading 2 bytes, make your tx and rx array 3 long. The command should be at tx[0]; the response will be available at rx[1] and rx[2].

Children
Related