Part Number: TMS320F28379D
Upon inspection of the example code in C2000Wate (driverlib\f2837xd\examples\cpu1\spi\spi_ex2_loopback_fifo_interrupts.c) for SPI loopback, I don't quite understand what is the logic begind the SPITXINT interrupt.
First, the technical manual states :
"In FIFO mode, the SPITXINT behavior is similar to the SPIRXINT. SPITXINT is generated upon a match
condition between the current transmit FIFO status (TXFFST) and the transmit FIFO interrupt level
(TXFFIL). If TXFFST is less than or equal to TXFFIL, the transmit FIFO interrupt flag (TXFFINT) will be
set. SPITXINT will be triggered in the PIE block if TXFFINT is set and the transmit FIFO interrupt is
enabled in the SPI module (TXFFIENA = 1)"
1- Why would the interrupt trigger if TXFFST < TXFFIL? If TXFFST is zero, isn't the FIFO empty? If the FIFO is empty, why would the interrupt be generated?
2- Is the purpose of the interrupt is to fire whenever the FIFO queue is empty (or below it's level) in oder to keep the FIFO "filled", or is the purpose of the interrupt to send the data (i.e. call SPI_writeDataNonBlocking).
3- How is TXFFST increased? Debugging the example code spi_ex2_loopback_fifo_interrupts.c, I see that TXFFST is constantly zero. How is TXFFST supposed to ever change i.e. in which conditions is it incremented and in which conditions is it decremented?
Thanks!