Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE
I am trying to communicate and store data serially with AT45DB321E, a serial flash memory and everything works properly till data is received by the microcontroller.
I want to store output data from the slave into an array by directly storing receive buffer data to an array of defined size, but the buffer (SPIRXBUF) does not contain the data received by SPIDAT, which I'm checking with another array. The data received by SPIDAT in my set up is correct, but this data isn't being moved to SPIRXBUF, where it should be stored to read. I have included my configuration below.
SpiaRegs.SPIFFTX.all = 0xE060;
SpiaRegs.SPIFFRX.all = 0x6064;
SpiaRegs.SPIFFCT.all = 0x0;
SpiaRegs.SPICCR.bit.SPISWRESET = 0;
SpiaRegs.SPICTL.bit.MASTER_SLAVE = 1;
SpiaRegs.SPICTL.bit.CLK_PHASE = 1;
SpiaRegs.SPICCR.bit.CLKPOLARITY = 0;
SpiaRegs.SPICTL.bit.TALK = 1;
SpiaRegs.SPICTL.bit.SPIINTENA = 1;
SpiaRegs.SPIBRR = 0x007F;
SpiaRegs.SPICCR.bit.SPICHAR = 0x7;
SpiaRegs.SPISTS.bit.INT_FLAG = 0;
SpiaRegs.SPIFFRX.bit.RXFFOVFCLR = 1;
SpiaRegs.SPICCR.bit.SPILBK = 0;
SpiaRegs.SPICCR.bit.SPISWRESET = 1;
SpiaRegs.SPIPRI.bit.FREE = 0;
The pins are initialized using the SPI example program function InitSpiaGpio(). I am storing my data like this in receive FIFO interrupt:
a[i] = SpiaRegs.SPIRXBUF; ab[i] = SpiaRegs.SPIDAT;
I have monitored all of the flags too and there are no instances of overrun, buffer full or overflow. How do I fix this problem?