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.
SPI is always dual-direction (even if the data in one direction is sometimes ignored) so if the master expects to receive 24 bits of data from the slave, then it must send out 24 bits to generate all the clocking for the 24 bits sent in the other direction.
Some implementations may provide a "read-only" SPI function which provides the clocks without you having to specifically supply some "dummy" data to write.
You have to check the Documentation for the specific device that you're using
okkk...I get it because of the shift registers present... Also one more thing how am I supposed to send these 24 bits????...3 dummy bytes one after the other ???
It is still not clear to me..please help.