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.

understand FIFO

Hi Folks

I think I may have failed to understand how the FIFOs (im using the ones on SCIA) are supposed to be used.

For example in my application I wish to transmit and receive an undefined string of data (though it does have a max length, say 23 words for eg)

If the Rx/Tx interrupts will not be raised until the level in the FIFO has been met how does this work with stings that may not reach this level? 

E.G. If my Rx level is set to 4 and 23 words are sent to my SCI FIFO, the Rx interrupt will be raised 4 times, for the first 20 words but then will not be raised for the final 3 words as they will not reach the FIFO interrupt level of 4 and unless Im then polling the FIFO as well I will never know about those three words.

Have I understood their use correctly? Should I be waiting for the interrupt each time or should I be reading it out continuously after the first interrupt? or should I be waiting for each interrupt and then when I have time checking to see if there is any left over words in the FIFO?

Thanks

  • Toby,

    Your understanding is correct.  In the example that you gave, RX FIFO will not generate an interrupt for the last 3 bytes until one more byte comes in to the RX FIFO.  The intention of FIFO interrupt itself is to reduce the CPU overhead in polling FIFO status and just read the FIFO only when FIFO receives certain user configured number of bytes.  If you don't know the number of bytes that SCI will be receiving and if you want to make sure that each and every byte is read as it arrives, use non-FIFO mode.  OR use a CPU timer to timeout as required after every receive interrupt and check the RX FIFO status to see if any bytes are left unread.

    Thanks and regards,
    Vamsi

     

  • Many thanks Vamsi