Lots of people also have trouble when logging to an SD card, because an atomic write operation can take up to 100ms. This causes the same input buffer overflow (GPS character loss) that you are seeing.
I developed my library,
NeoGPS, to overcome this issue, among others. There's even a section about
parsing during the RX char interrupt, which avoids the whole buffer size question. This requires using some alternative serial libraries that are drop-in replacements for the standard HardwareSerial, SoftwareSerial and AltSoftSerial libraries.
NeoGPS is smaller, faster and more accurate than all other libraries, and you can edit the configuration files to ignore fields and sentences that you don't really use. For example, if you only need the time, you can configure the library to only parse the time from a ZDA message. This makes the library even smaller and faster.
The other thing to note is that NeoGPS parses characters and emits a complete "fix". The fix structure contains all the fields from all the sentences received in one second (i.e., each update interval). This is unlike other libraries that parse characters and emit one sentence. Your main loop would look something like this:
gps_fix latest_fix; // a structure containing GPS fields
while(1){
while (gps.available( gpsSerialPort )){
latest_fix = gps.read();
}
calculations, variables updates, etc.
draw char and shapes on LCD;
if (latest_fix.valid.time)
draw latest_fix.dateTime.seconds on LCD;
...
various_functions();
more LCD stuff;
print_everything_on_LCD();
}
However, this appears to be constantly updating the LCD. If the LCD is only displaying GPS information, or your calculations only need to be performed with the GPS information changes, you might want to restructure your loop like this:
gps_fix latest_fix; // a structure containing GPS fields
while(1){
while (gps.available( gpsSerialPort )){
latest_fix = gps.read(); // new info!
calculations, variables updates, etc.
draw char and shapes on LCD;
if (latest_fix.valid.time)
draw latest_fix.dateTime.seconds on LCD;
...
various_functions();
more LCD stuff;
print_everything_on_LCD();
}
other_non_GPS functions()
}
NeoGPS is available from the Library Manager if you're using a current version of the IDE, or you can get it from the link above. Be sure to check out the examples.
Cheers,
/dev