Hi I am trying to make an SPI interphase wihtout interrupts. When i send one byte I just check the SPSCR register until the flag SPRF goes high
WAIT: BRCLR #7,SPSCR,WAIT
At that moment I know that i sent one byte. Now, I want to know if I can do the same thing to wait for response. And in this case, I check the SPRF flag or the SPTE flag? I can´t tell the difference between them.
Thanks
SPI is normally configured as a simultaneous bidirectional interface. This means that when you send one byte, a byte is also received. This is due to the fact that SPI has only one clock signal provided by the master.
If you are checking status of a remote device after issuing a command you must send the command and then send another dummy byte in order to clock in the response byte. The remote CPU or device cannot see the command until after it is clocked in and then must formulate a reply and wait for the master SPI device to send the dummy byte to it can respond.
Good Luck,
Peter House