PIC16F88 USART TXIF NOT READY IMMEDIATELY AFTER WRITING TXREG I have a routine to send 3 bytes out the uart. The txif flag is checked first to ensure the tx buffer is ready to accept another char. If I put a char in the txreg and immediately check txif, it seems to say "ready for next char" but in fact, ignores it. In the code below, if the nop's are removed, only the first and third char are sent; the second does not appear. With the nops, all three chars are sent. Am I doing something real dumb, misunderstand the uart or ??? Why do the nops seem to be needed here? send3bytes ; typically aa/55/00 or aa/55/01 btfss pir1,txif ; uart ready to transmit? goto send3bytes ; uart busy; keep trying movfw databuf movwf txreg nop ; may not need 2 nops but fails to send 3 bytes nop ; if no nops are here send3a btfss pir1,txif ; uart ready to transmit? goto send3a ; uart busy; keep trying movfw databuf+1 movwf txreg nop ; may not need 2 nops but fails to send 3 bytes nop ; if no nops are here send3b btfss pir1,txif ; uart ready to transmit? goto send3b ; uart busy; keep trying movfw databuf+2 movwf txreg return Other possibly pertinent info: internal 4MHz osc, baud rate = 19.2K, transmit only, receive not used or connected. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist