XMC1000 TIP of the day: Indication for the completion of data transmit in UART

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
When using UART with FIFO buffer, there is no indication provided when the last data in the FIFO buffer had transmitted out.
Due to this, if application that require this indication may find it difficult to implement.

Here, we would like to introduce a workaround to get this indication.
When USIC In UART mode, there is a flag to indicates frame finished event (PSR.TFF).
This flag is set when the each data byte is finished transmit out. (Word length = Frame length = 8-bit)
So, by polling this flag (or set an interrupt) to count the number of data has been transfer out, we know exactly how many data has been transmitted out.
When the number of bytes push to the FIFO match the number of bytes count by the frame finished flag, this indicated the last data has been transmitted out.

Note: Each time after the flag is set, the flag has to be cleared immediately in order to count the next frame finish event.
0 Likes
0 Replies