This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI interface with peripheral devices

Sir,
I am learning SPI interfacing. I am using P89V51RD2FA microcontroller.
And I have to interface it with a device using SPI interface but the problem is that I don't know what to do when I have to obtain data more than one byte.

Like in my case I need 3 bytes of data from the device. So after the usual write commands(giving command to read and the register to be read) and all, I am supposed to send some dummy byte which will be 0s. I wish to know that will the device return me three bytes just by one dummy byte or I need to send one dummy byte for each byte to be received.

Parents
  • That's a pretty common chip, and a very common interface.

    Have you searched for examples?

    What peripheral, specifically, are you trying to use?
    Again, have you searched for examples?

    "send some dummy byte which will be 0s"

    If you send any dummy bytes, 0xFF is more likely to be appropriate...

Reply
  • That's a pretty common chip, and a very common interface.

    Have you searched for examples?

    What peripheral, specifically, are you trying to use?
    Again, have you searched for examples?

    "send some dummy byte which will be 0s"

    If you send any dummy bytes, 0xFF is more likely to be appropriate...

Children