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.

TMS320F28377S: SPI FIFO Operation

Part Number: TMS320F28377S
Other Parts Discussed in Thread: CONTROLSUITE

Hello TI community,

I was wondering how exactly does the FIFO work for the SPI. I am looking at the example code in controlSUITE. I understand that writing the spi transfer buffer will write to the fifo. The fifo then writes to the SPI shift register, sending MSB bits out first. Let's say I do three write operations to the transfer buffer using a for loop such as:

for(i=0; i<3; i++)

{
spi_xmit(SPI, sdata[i]);
}

given

void spi_xmit(volatile struct SPI_REGS *SPI, Uint16 a)
{
(*SPI).SPITXBUF = a;
}

Will the chip understand that after each write statement to write to the FIFO in time for the next transfer function write? Or will this cause issues in timing?

  • Hi Brenden,

    The FIFO is an automatic buffer. As long as there is data which is currently being sent, the data will be appended to the FIFO for transmission in the order it was written. After the current data is finished transmitting, the next data will automatically be copied into the shift register and start its transmission. The only thing you need to be careful of is that you do not write more data than the FIFO can hold.

    Regards,
    Kris