# When to monitor UxSTAbits.TRMT and UxSTAbits.UTXBF

According to the reference manual on UART for PIC here(page 7), the UxSTA register have two read-only bits; TRMT and UTXBF. While writing a simple transmission program over UART, I didn't notice any change if I include

while(UxSTAbits.TMRT != 1);


or

while(UxSTAbits.UTXBF);


before I send anything with the UxTXREG buffer. In what case is each of these bit relevant?

UxSTAbits.UTXBF bit indicates if the FIFO is full. If the FIFO is not full, you can write to UxTXREG register.
UxSTAbits.TMRT indicates if the last transmission has completed (FIFO and shift register are both empty). You should not turn off the UART or put MCU into sleep while the transmission is not completed. If you are not planning to do those, you can safely ignore the state of this bit.