You don't specify which PIC you're using, but the UARTs tend to be similar. From http://ww1.microchip.com/downloads/en/DeviceDoc/41350C.pdf, we find: 16.1.2.4 Receive Interrupts The RCIF interrupt flag bit of the PIR1 register is set whenever the EUSART receiver is enabled and there is an unread character in the receive FIFO. The RCIF interrupt flag bit is read-only, it cannot be set or cleared by software. So, the RCIF=0 does nothing since the bit is read only. As others have pointed out, there is a small FIFO in the UART. Because of this, I'd change the if(RCIF) to while(RCIF). This will loop the routine that pulls data from the UART until it is empty. Finally, I like putting stuff from the UART ISR into a FIFO instead of a linear buffer. In your non-interrupt code, you can pull data from the FIFO and put it in the linear buffer for command interpretation at your leisure. Putting data into the command interpreter buffer in the interrupt requires the mainline code to act quickly on finding the end of command before new data comes in and overwrites the command. Or, the command interpreter could be in the ISR, but I like to keep them small and fast. Of course, if the other end does not send a new command before getting a response from this end, dropping directly into the linear buffer would work fine. In a recent project (movie theater closed captioning receiver), I have packets of data coming in at 10kbps. It takes a variable amount of time to deal with the data (most of the time just sticking it in a linear array, but at the end of a packet doing a CRC check and then acting on it if good), so the amount of data in the FIFO between the ISR and the mainline code grows and shrinks as required so nothing gets lost. Good luck! Harold > > if (RCIF) > > { > > char c = RCREG; > > > > SerialRecordCharacter(c); > > > > RCIF = 0; > > } > -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist