I've took a look at status register, it contains 3-bits: Read buffer full flag, Transmit empty flag, Fault flag.
As I can see, transmit data register is empty doesn't mean "transmit complete",
Data may still in the shift register. If then I disable spi peripheral, error will occur.
Solved! Go to Solution.
Have you tried checking the read buffer full flag? A byte is clocked in with every byte that is clocked out, so by the time the received byte is marked complete your transmitted byte should be finished as well. Keep in mind that you'll need to make sure the read full flag is cleared before you start the transmission.
Scott
Have you tried checking the read buffer full flag? A byte is clocked in with every byte that is clocked out, so by the time the received byte is marked complete your transmitted byte should be finished as well. Keep in mind that you'll need to make sure the read full flag is cleared before you start the transmission.
Scott