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.

eUART UCTXIFG vs. UCTXCPTIFG

I looked over all the text I can find, including the slau423a.pdf and http://www.ti.com/lit/an/slaa522a/slaa522a.pdf, but still cannot understand the difference when each would be triggered, or are they triggered at the same time?  I have been looking for the answer for days now.

  • TXIFG is set whenever the TXBUF is empty. When you write to TXBUF, its content is sooner or later moved to the output shift register. TXBUF is empty again, TXIFG is set and you can write the next byte to TXBUF while the previous one is still being sent. This allows continuous transfer and maximum throughput (double buffering). TXCPTIFG is set, when the output shift register is empty too, so the last byte you wrote to TXBUF has been sent, including the appended stop bit. So TXCPTIFG is set when the transfer is actually completed adn the eUSCI TX part goes to idle state.

    If implementing half-duplex protocols such as RS485, this is vital. Also, if you want to go into LPM and need confirmation that the USCI clock is no longer needed. Or that you can release a chip select signal.

    So the one tells you that you can stuff one more byte into the output queue, the other tells you that everything has been sent. About 10 bit times later.

  •  Your description is confirmed by slau367m.pdf, thanks.  The documentation is silent about resetting TXCPTIFG?  Please confirm that both TXCPTIFG and UCTXIFG is reset when TxBuf is written to?

  • That is correct ctm, UCTXCPTIFG operates in the same manner as UCTXIFG except that it waits until the entire byte has been shifted out (transmitted) including the STOP bit. It obviously takes more time for this to occur and because of the USCI42 errata (UCTXCPTIFG asserted after each byte regardless) most applications prefer to use UCTXIFG instead.

    Regards,
    Ryan
  • that is how it is supposed to work. Unfortunatly it is broken. At least in the eUSCI modules I've looked at included the eUSCI on the MSP432. There is an errata for this bug, USCI42.

    The problem is the logic doesn't look at the state of the TXBUF and sets TXCPTIFG whenever it sends a stop bit. Which isn't what you want.

    So one needs to look at the errata for which ever chip you are using to see if the eUSCI implemented has the bug.

**Attention** This is a public forum