TXIF is what I use to see if it is safe to load the TXREG. -----Original Message----- From: Nathan House To: Microcontroller discussion list - Public. Sent: Thu, Sep 1, 2011 8:10 pm Subject: [PIC] TXREG not being cleared My PIC18 datasheet says the following: "Once the TXREG register transfers the data to the TSR register ... he TXREG register is empty ..." In my ISR, I have this: if(PIR1bits.RCIF =3D=3D 1) // if the USART receive interrupt flag has be= en set { if(TXREG =3D=3D 0) // check if the TXREG is empty { TXREG =3D RCREG; // echo received data back to sender } =20 PIR1bits.RCIF =3D 0; // clear the USART receive interrupt flag } know it's a good idea to check and make sure there isn't data aiting to be sent, so I added the IF statement to check if the TXREG egister is empty. The problem is, it's not being cleared, although he datasheet says it should be. Using my ICD3 debugger I set a reakpoint in the ISR, and after the first byte is received and echoed ack, no more bytes get sent, which is because the TXREG contains the irst byte sent and is never cleared. Why would this be? Is there a etter way to check if it's "safe" to send data? Thanks! Nathan --=20 tudent Hobbyist ww.roboticsguy.com -=20 ttp://www.piclist.com PIC/SX FAQ & list archive iew/change your membership options at ttp://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .