Interrupt Driven Serial Routines with Circular FIFO for PIC Micro
This is another routine that I want to share. This is the Interrupt Driven Serial Routines with Circular FIFO for PIC Micro. This routine uses the PIC’s hardware USART. Since this is unbuffered, so I added a software FIFO. The FIFO management is quite lean and fast but required the size of the buffer to be power of 2 (2^x). This is because FIFO roll-over uses bit-wise AND of (buffer_size - 1). This reduces code size due to that no more conditionals to test pointers overflowing the buffer.

