>What I did was use the whole 80 locations of BANK2 to act as a buffer. >I needed a complete sentence before I could process the data. Using >this technique works well, but seems to waste a lot of memory >locations. A flag is then set once the buffer wither fills up or the >end character is read and then a routine in the main loop does all the >processing as slowly, and throwing away of junk, as slowly as it wants. > >BTW it was NMEA from a GPS, and some of the sentences it sends are >quite long. Rather than set it up as a buffer, set it up as a circular FIFO. Your code that uses the data (the non-interrupt code) should be reading the string looking for the NMEA header, deciding if this is the header it wants, and processing the string as it reads it, until the carriage return. If it is not the header it wants, then it discards the string until the carriage return. Olin has such a UART interrupt driven module in his development environment, and I have a converted version of Fr. MacGhee's uart code using Olin's macros to do the FIFO operation under interrupt receive. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu