> I understand the meanings of the flags but my question > still remains. Can you give an example where > testing TRMT allows you to do something that just > testing TXIF exclusively couldn't do? The two flags have different meanings and purposes. Most of the time you want to know when it's OK to write another byte to TXREG. You check TXIF for this, or use the TXIF interrupt. See the HOS_UART.ASPIC module at http://www.embedinc.com/pic/hos.htm for an example UART handler that uses the TXIF interrupt. The application calls UART_PUT, which writes the byte to a FIFO. It doesn't get written to the UART until the UART is ready for it. The TXIF interrupt is used to transfer one more byte from the FIFO to the UART. The TRMT flag tells you that the whole byte has actually been sent on the wire. Most of the time you don't care, but it can be important to know if the wire is being shared. I've only used the TRMT flag twice that I can remember. Once was when the UART was connected to a RS-485 bus. The firmware had to know when the last packet byte was actually sent before reversing the bus driver hardware from transmit to receive. The other time was making sure the last byte was physically sent before powering down. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body