you are so nice to reply me very well. Thanks a lot
as you said i will try to change slave SPIDR within the interrupt subroutine. For example if i take at the beginning slave SPIDR will have S value. And when the master sends the M value it will take S from slave. and within the slave receive interrupt subroutine i will write SPIDR L value immediatly after reading SPIDR which has M value.
but if you have any application example for salve it would be better to have.
Master 10 3F 00 Slave 00 00 33
Yes, you are correct - the slave send data must be written to the SPI send buffer prior to the next interrogation by the master. So, when the slave SPI send buffer empties, the next send byte would be written, ready for a further transaction.
In many cases, this process for the slave is best handled within an ISR for the SPI, depending on the amount of data to be sent by the slave. Using a FIFO buffer would allow the ISR to automatically load the next available byte to the SPI send buffer.
"The master will send 10, 3F,00 and slave will take theseAnd the slave will send 00,00,33 and the master will take these"
"for my codes; i want to send these information that 'M','A','S','T','E','R' from master to slave. And these 'S','L','A','V','E','00', are from slave to master. could you say me any way?"
"MOSI is connected to MOSIMISO is connected to MISOSCK is connected to SCKSS is connected to Vcc=5V on master sideand SS is connected to gnd=0V on slave sideare these connections true?"
Message Edited by bigmac on 03-24-200608:52 PM