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.

TMS 28035 SCI RX FIFO operation

Other Parts Discussed in Thread: CONTROLSUITE

Hello, 

I think I am misunderstanding how the RX FIFO on the Scia is meant to work.

I am letting the FIFO fill, and then reading  the buffer when it has 2 or more characters:

if (SciaRegs.SCIFFRX.bit.RXFFST >=2)

{

while(SciaRegs.SCIFFRX.bit.RXFFST !=0)

{

SciaRegs.SCITXBUF =(SciaRegs.SCIRXBUF.bit.RXDT &0x00FF); /*echo to TX for test*/

}

}

But I am only getting 1 character written to the TX buffer. Using the debugger, SciaRegs.SCIFFRX.bit.RXFFST changes to 0 as soon as I read SciaRegs.SCIRXBUF.bit.RXDT. 

Notes:

-If I enable and disable the FIFO, I can see that SciaRegs.SCIRXST.bit.RXRDY will change to 1 when the FIFO is disabled and stays at 0 when FIFO is enabled.

-Looking over the memory in the debugger and the data sheet, I cannot see where the FIFO buffer memory is for more than a single element.

Questions:

-Am I reading the FIFO correctly by reading the SciaRegs.SCIRXBUF.bit.RXDT or should I be reading a different register?

-Is there a way to see what characters are in the FIFO with the debugger by finding a specific set of memory addresses?

-When the FIFO is overrun, is the first element in dropped as the last element shifts in, or is the last element overwritten?  If this is listed in SPRUGH1C, I don't think I understood it.

  • You reading the RXFIFO correctly.

    There is not a way to see all the characters in the FIFO.

    I believe the FIFOs are circular buffers, so the first element would be overwritten.

    RXDRY and TXRDY will not work when FIFO is enabled.

    Are both RXEN and TXEN set? Are both RX and TX enabled? What are you seeing out of the Tx pin?

    sal
  • Running this code:

    int16 forCounter =0;
    for (forCounter = (SciaRegs.SCIFFRX.bit.RXFFST&0xF); forCounter>0; forCounter--)
    {

    SciaRegs.SCITXBUF = (SciaRegs.SCIRXBUF.bit.RXDT &0x00FF);

    }/*end for loop*/

    Currently, I am seeing the output, but 4 characters delayed from the input. Trying to read the buffer 4 times when I am done setting up the SCI configuration does not clear them out at all.  

    still seeing the SciaRegs.SCIFFRX.bit.RXFFST switch to 0 at the first read of SciaRegs.SCITXBUF, but even if I add

    if ((SciaRegs.SCIFFRX.bit.RXFFST&0xF) < 3) return; 

    before the for loop, when I look at the value of SciaRegs.SCIFFRX.bit.RXFFST after that line it shows 1, and the TX buffer never gets the additional values written. The loop does run 3 times in this case when I step through the code. If I sent "123" to the terminal I get "3", and no other characters though (no quotes in terminal).

    I do have optimizations turned on which I will assume would alter the debug results, but the results on the terminal are still not correct.

  • PS...
    TXRDY seems to still work with the FIFO turned on, I was testing using this flag working with the TX FIFO and it appeared to be changing states the way I expected.
  • Jim,

    Have you looked at the sci examples in controlSUITE, particularly controlSUITE. You can look at the examples for other devices as well since they should have the SCI module on them. The difference is the SCI FIFO size may change. Some are 16 deep. Some are 4 deep.

    sal
  • Please also refer to the Technical Reference Manual or SCI documentation for this device.

    sal