AnsweredAssumed Answered

How can I make flushing SPI TX work?

Question asked by oldfoxsoftware on Sep 13, 2016
Latest reply on Oct 17, 2016 by Jithul_Janardhanan

The SPI driver I developed for the ADSP21479 initializes, transmits, and receives in master mode using SPIB. Since the application that uses this driver switches back and forth between transmitting and receiving I need to flush the tx buffer (*pSPICTLB |= TXFLSH). Otherwise the value that was last put into the tx buffer pTXSPIB by the dummy write inside my SPI_Receive function will be sent out with the first write in my SPI_Transmit function. (Instead of a dummy write in the receive function I also tried to switch to receive mode by clearing TIMOD1. But that has the same effect. It clocks a value into pTXSPIB when reading pRXSPIB.)


Attached are my SPI_Init, SPI_Transmit, and SPI_Receive functions.