Dear all,
How to communicate At89c51rd2(Master) with At89c51rd2(Slave) using SPI protocol.I am using seperate pins for spi(not the dedicated pins of spi protocol).I am using 20 Mhz crystal for both and same power supply.How to read/write from master to slave?
regards, krishna
Did you spend some time reading the user manual? Do you understand how SPI works? What have you done so far? What do you expect from the forum? A ready to run solution?
Yes, I worked on SPI protocol for my past two projects but there I have used only devices with only one MCU.I have written some default values in slave controller and trying to read from the master.Thank you very much for your response.
If you use generic GPIO pins, then the answer is simple. You will have to bit-bang the communication, following any of a million available documents about how SPI works. You just have to decide yourself which of the four variants to use for clock and phase.
Footnote - it is trivial to bit-bang the master.
If you have placed yourself in a situation where you have to bit-bang the slave, then you better make sure to run the master slowly. You really, really, really should do everything you can to avoid bit-banging an SPI slave.
If you have placed yourself in a situation where you have to bit-bang the slave, go buy a "family size" bottle of aspirin
Erik