Need some help for a FIFO Buffer in C code

Status
Not open for further replies.

NIALA

Junior Member level 1
Joined
Jun 9, 2010
Messages
19
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Minneapolis
Activity points
1,408
Hi

looking for some hint(concept) to wrote a FIFO Buffer code . to be used in a code controlling a PIC16F877A with ISR and USART communication.

thanks
 

Maintain two pointers namely write pointer and read pointer. Initially both the write pointer and read pointer will point to the first location of FIFO (called front). Once you add something to FIFO buffer increment the write pointer to the next location. After reading of each element of the FIFO you have to increment the read pointer to the next location *** provided your FIFO is not empty. If your FIFO is empty you should give UNDERFLOW message. Similarly for the writing also.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…