The EUSCI users guide for the FR5xx processors has a bit of an inconsistency regarding the clearing of the UCTXIFG flag.
Section 30.4.7 describing the UCAxTXBUF includes the following;
Writing to the transmit data buffer clears UCTXIFG
This is what I expected, but it's not the behaviour I'm seeing. However in an earlier section, 30.3.15.4 on the UCAxIV Interrupt Vector Generator, it includes the following;
Read access of the UCAxIV register automatically resets the highest pending interrupt and flag
This matches the behaviour I am seeing. A TX interrupt is raised, and once the handler reads the IV to determine the interrupt, the TXIFG is cleared.
I'm in the process of porting some code from the older USCI, and from what I can see reading that user guide, writing the TXBUF was the only mechanism to clear the TXIFG. The logic is erroneously assuming the TXBUF is not in a state to be written because the TXIFG is clear. Could someone confirm that what I am seeing is the way things are supposed to work - that the TXIFG is cleared immediately the IV is accessed.
Either way, the documentation should be tweaked to be clearer. I assume that writing TXBUF will still ensure the TXIFG is cleared, but if operating in an interrupt model, that will have already been done when accessing the IV.
Thanks and regards - Andrew