Edson, I have implemented the routine you mention for the 17c44; I think it could be adapted to the 877 with almost no change. I use it for receiving chars from the serial port of the computer. The buffer is 16 bytes long, and starts from 0x20. recNum is the number of bytes actually stored in the buffer. recPtr is the pointer to the last received byte. This is the chunk of code for initializating the FIFO: ...... clrf recNum ;set the FIFO to empty movlw 0x20 ;set the next byte to the FIFO base movwf recPtr ...... Next is the receiving (FIFO in) routine. I adapted it from a multiple bytes receiving routine; in this case it receives just one byte at a time. Maybe it could be semplified somehow. rec1Byte is a routine which receives one byte from the serial port; it returns with the received byte in tmpReg2, the number of received bytes in tmpReg1 (this is 1 in this case), and an error code in errCode (0 for no error; this is also used to complete reception and exit the routine). recLoop call rec1Byte movlb 0 tstfsz errCode goto recCompl ;an error occurred movwf tmpReg2 movfp recNum,WREG incf recNum addwf recPtr,0 bcf WREG,4 movwf FSR0 movfp tmpReg2,INDF0 decfsz tmpReg1 goto recLoop Next is the fetching (FIFO out) routine. If the buffer is empty, it returns with an error code in errCode (0 for no error), else it returns with the fetched byte in WREG fetchNextRcCh movlb 0 clrf errCode tstfsz recNum goto valChar movlw eEmptyRecBuf movwf errCode retlw 0xff valChar movfp recPtr,FSR0 decf recNum incf recPtr bcf recPtr,4 movfp INDF0,WREG return Hope this helps. Regards Leonardo Perretti leo.perretti@projectpp.it Edson Brusque wrote: > anyone here have implemented a FIFO (First In, First Out) buffer for the >hardware USART of a PIC? I'm using a PIC16F877 and it does have to receive >USART and put it on a buffer for later processing. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.