This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Why do I get two unexpected spiTxFifoIsr() interrupts when using the TI demo SPI code?
I'm using the TI example code Example_280xSpi_FFDLB_int.c which demonstrates SPI using loopback mode, FIFO, and interrupts. I am using this as a template to configure an SPI slave that is not in loopback mode. I have modified the following TI initialization function as follows:
void spi_fifo_init()
{
// Initialize SPI FIFO registers
SpiaRegs.SPICCR.bit.SPISWRESET=0; // Reset SPI
/////////////////////////// Original TI Code/////////////////////////////////////////
// SpiaRegs.SPICCR.all=0x001F; //16-bit character, Loopback mode
// SpiaRegs.SPICTL.all=0x0017; //Interrupt enabled, Master/Slave XMIT enabled
//////////////////// Modified for Not-Loopback, Slave Mode////////////////////////
SpiaRegs.SPICCR.all=0x000F; //16-bit character, Not-Loopback mode
SpiaRegs.SPICTL.all=0x0013; //Interrupt enabled, Slave XMIT enabled
SpiaRegs.SPISTS.all=0x0000;
SpiaRegs.SPIBRR=0x0063; // Baud rate
SpiaRegs.SPIFFTX.all=0xC028; // Enable FIFO's, set TX FIFO level to 8
SpiaRegs.SPIFFRX.all=0x0028; // Set RX FIFO level to 8
SpiaRegs.SPIFFCT.all=0x00;
SpiaRegs.SPIPRI.all=0x0010;
SpiaRegs.SPICCR.bit.SPISWRESET=1; // Enable SPI
SpiaRegs.SPIFFTX.bit.TXFIFO=1;
SpiaRegs.SPIFFRX.bit.RXFIFORESET=1;
}
Whenever I run the code on an ezF2808 board I get two calls to the spiTxFifoIsr() ISR. I do not have a master SPI device connected to the SPI pins. I am monitoring the lines on a scope and none of them are being actived. I am confused as to why these intial two interrupts are occuring. Any thoughts?
-Scott
Hello Raffaele,
I call spi_fifo_init() function during initialization of the peripherals. I call this function from main() only once.
No, I never did solve the problem. I just went around it an disabled the TX interrupt since my slave does not transmit. I don't have time right now to try the suggestion, so if you could post your results once you try the suggested fixed I would appreciate it. Thanks.
-Scott
p.s. Do either of you know of a location of a more active TI forum? This forum is pretty slow.
This is an young forum.. I think will be more active next months..
I know many people that use forums only to keep informations without give help and this is the reason for many users registered with no posts active...
So, we have only to wait..