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.

CCS/TMS320F28069: F28069 SCI communication problem

Part Number: TMS320F28069

Tool/software: Code Composer Studio

Hello,

I am programming F28069 device to transfer a block (256 words) of data to PC through Serial Communication Interface.

Looks like I have to put a delay between every two words as below:

            for(index=0;index<256;index++)
            {
                SciaRegs.SCITXBUF = block_0[index] ;
                DELAY_US(800);
            }

otherwise there are always some data missing,  less delay causes more data miss. without a delay, there are only 5 words transferred.

I wonder if this is correct. Because with fifo enabled, I don't think a delay is needed here. Plus, the baudrate setup matches between PC and the device. And the fifo is configured as follows,

void scia_init(void)
{
    //fifo init
    SciaRegs.SCIFFTX.all=0xE040;  //SCI Reset,SCI FIFO enable,TXFIFO int clr
    SciaRegs.SCIFFRX.all=0x2062;  //RXFIFO int clr, RXFIFO int enable
    SciaRegs.SCIFFCT.all=0x0;

    //sci init
    SciaRegs.SCICCR.all =0x0007;   // 1 stop bit,  No loopback
                                   // No parity,8 char bits,
                                   // async mode, idle-line protocol
    SciaRegs.SCICTL1.all =0x0003;  // enable TX, RX, internal SCICLK,
                                   // Disable RX ERR, SLEEP, TXWAKE
    SciaRegs.SCICTL2.all =0x0003;
    SciaRegs.SCICTL2.bit.RXBKINTENA =1;
    // Baud Rate ~=14400
    SciaRegs.SCIHBAUD    =0x0000;
    SciaRegs.SCILBAUD    =0x00C2;

    SciaRegs.SCICTL1.all =0x0023;     // Relinquish SCI from Reset
}

Can someone point out if I get anything wrong?

Thanks

Ning

  • The F2806x only has a FIFO which is 4 bytes deep. It is quite possible that you are overflowing the FIFO.

    Instead of using a delay, before writing to TXBUF, wait until the TXFFST is less than 4, and then write the data to TXBUF.

    sal
  • ok thanks. So, just to confirm, if I want to send data as fast as possible, I should set TXFFIL4-0 = 3, that is whenever there is a space in the FIFO, transfer a byte to TXBUF. is it correct?
  • Yes, that is correct.... if you are using interrupts. TXFFIL is the FIFO interrupt level. If there are three elements in the FIFO or less, the SCI will generate a TX interrupt, in which you would send data by writing it to the TXBUF.

    sal