Most probably 'yes' - it depends how you set the data for the slave response.Is this normal behaviour?
Remember that, on SPI, each 8-bit transaction transfers in both directions. So when the master sends out the first byte, it is also receiving the first byte from the slave, which will be whatever is already in its output register.
So you may be able to pre-load the slave's output register with the first byte of its response.
If the slave starts to compute a return message as soon as SPI transfer starts, then that will be returned starting with the second byte of the response.
In some situations the slave doesn't know what data to return until its received the first character (or more) of the data from the master, in which case you'll need to insert a dummy cycle (or maybe more than one) to give the slave time to compute the return data. (I think this situation is probably what you are seeing)
Statistics: Posted by stevend — Fri Apr 18, 2025 7:16 am