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.

UART FIFO RT Interrupt not triggered

Hi,

Background: Used the UART communication with the slave. But the length of the received the message is unknown. So I want to use the RT (receive timeout) flag of the UART peripheral in order to detect an "end of message".

Question: If the number of packets received just an integer multiple of the FIFO depth is set, it will not generate a timeout interrupted. Such as setting FIFO depth is 12, if the received packet size is 132 bytes, enter 11 after the interruption (actual) receive complete, but the program does not know whether the reception is completed. When I want to use a timeout interrupt, receive data reception is considered complete, and can not produce this time-out interrupt. If the received message length is 133 bytes, then break into the receiver 11 is completed, the receiver will enter a timeout interrupt, the program can check the data in time-out interrupt when received correctly.

The datasheet describes this as :"The receive timeout interrupt is asserted when the receive FIFO is not empty, and no further data is received over a 32-bit period."

             Since the received packet length is unknown, there is always likely to be an integer multiple of the FIFO depth, so as not to generate a timeout interrupted.

     Is there any good way to solve this problem? 

  • Hello Maojun,

    One of the things we do is use a Packet Structure, where a Packet can be made as follows over UART

    STARTPACKETCODE : LENGTH : BYTES EQUAL TO LENGTH

    When we receive the Start Packet Code, we use the interrupt to get the next byte. which would be the length of the rest of the packet. In such case a RT is not required as we use the regular interrupt to read out the data and decrement the variable holding the length till it becomes 0

    Regards

    Amit