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.

TMS320F28388D: How UART obtains the data frame length in specific application scenarios

Part Number: TMS320F28388D

I use the receiving UART interrupt to get data. The FIFO level of RX is 7/8. When the FIFO receives 14 bytes of data, the RX interrupt will be triggered. At the same time, the timeout interrupt is also enabled. Under normal circumstances, data reception is normal, and I can increase a counter in the interrupt. When the timeout interrupt comes, I know that the current data frame has been received and the length of the data frame can be recorded. But when the length of the data frame is a multiple of 14, after the last byte is received, only the RX receive interrupt is triggered, and the timeout RT interrupt is not triggered. In this way, I can't judge whether the data has been received, because the data frame I receive is variable in length, so I can't judge whether the data is received through the RX interrupt.
My question is is there any way to know the dataframe length in this case?

  • Hi,

    The configuration of RX buffer depth allows you to configure the interrupt issue time. Is there any issue that you're facing to read the data through the RX interrupt? That should be giving you the correct result.

    If you're unsure of the data frame length, you can choose to configure it in nonFIFO mode. Do you think this would help you with your application?

    Regards,

    Aditya

  • Hi, The RX interrupt is fine.

    If I don't use FIFO, the CM core will trigger an RX interrupt after receiving each byte, and the timeout interrupt will not be triggered after the last byte is sent (even if I enable it). In this way, I still can't judge how many bytes of data have been received.

  • You can still keep a count within the Interrupt Service Routine through a local counter, right? Wouldn't this be helpful?

    Aditya

  • But I don't have the conditions for judging the end of data reception.

  • Let me pull in another expert as well here. Unfortunately, I haven't come up with a similar use case earlier.

  • Hi sw w,

    Re-iterating Aditya's comment with a screenshot of the interrupts section.

    Without FIFO, you can still trigger an interrupt for each byte just like you're doing. Make the counter variable count up each time the RX interrupt occurs.

      

    For the second comment you mentioned:

    But I don't have the conditions for judging the end of data reception.

    That is a system issue. You have to make a way in your system (not something we can define) to let the whole system know (including the C2000 device) that you have reached the end of transmission. There's different ways to do this, but it's up to the system designer to choose that.

    Regards,

    Vince