Hello again, I was doing some reading and have even gotten a "master" SPI working on my microcontroller. Here is my question, basically if the master wants to initialize a write to the slave we write to the SSPBUF, how do we control what the slave responds with? The datasheet doesn't seem really clear to me the order of events in that case.
I.E. Master puts a char into the SSPBUF, this initiates the SPI module to send data to the slave, during the shift, the slave returns a byte.
In the slave side, is there something that tells you you have incoming data, and you can write to your SSPBUF first, THEN accept the data?
OR
Do you have to write to the SSPBUF the first "return value" you want sent back before the master can have an opportunity to initiate a transfer?