> Hi all, > i4m trying to comunicate a PC with a PIC16f874(clock 4 MHZ) > using the USART asynchronous mode at 9600 bps. The length of > each message is 8 bytes (8bits,Non Parity,1Stop bit). This PIC has > a FIFO buffer(Register RCREG) of two bytes, > the buffer before the third byte reach the buffer, And you should read the incomming byte as fast as possible after the flag is set (can't remeber the name, but you'll find it...) There is not need to wait for two bytes in the RCREG FIFO. Why wait ? You have to read each byte anyway, better do it at once. I do not think the "FIFO" was ment to be "used" in that way. > in the PIC to clean the buffer as fast as possible, Exactly *how* do you know when to read the incomming bytes(s) ? > but i 4m still having this problem. > Is there any good code to avoid it? Any code but yours, probably :-) :-) > Can it be done adding hardware? That should definitly not be needed at 9600 baud ! Just read each byte as they are received. Regards, Jan-Erik. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu