@6v6gt - great message. That prompted me to extract the salient code into a separate sketch.
#include "SparkFun_I2C_GPS_Arduino_Library.h"
const byte bMaxSentence = 85; // NMEA specifies 82 max
const long MONITOR_BAUDRATE = 250000;
I2CGPS myI2CGPS; //Hook object to the library
char NMEAsentence[bMaxSentence];
void setup()
{
String strConfigString;
Serial.begin(MONITOR_BAUDRATE);
// I2C_SPEED_STANDARD = 100000, I2C_SPEED_FAST = 400000
if (!myI2CGPS.begin(Wire, I2C_SPEED_STANDARD))
{
Serial.println("Module failed to respond. Please check wiring.");
for(;;); // Hang forever
}
Serial.println("GPS module found!");
strConfigString = myI2CGPS.createMTKpacket(220, ",1000"); // 100 for 10Hz, 1000 for 1Hz
myI2CGPS.sendMTKpacket(strConfigString); // Set Update Rate
strConfigString = myI2CGPS.createMTKpacket(314, ",0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0");
myI2CGPS.sendMTKpacket(strConfigString); // Just enable $GNRMC messages
}
void loop()
{
byte bNMEAindex = NULL;
bool bDollarFound = false;
while(myI2CGPS.available()) // Discard until $
{
if (myI2CGPS.read() == '$')
{
bDollarFound = true; // Flag success for next stage
NMEAsentence[bNMEAindex++] = '$';
break;
}
}
if(bDollarFound)
{
while((myI2CGPS.available()) && (bNMEAindex < (bMaxSentence - 4)))
{
NMEAsentence[bNMEAindex] = myI2CGPS.read();
if (NMEAsentence[bNMEAindex++] == '*')
{
NMEAsentence[bNMEAindex++] = myI2CGPS.read();
NMEAsentence[bNMEAindex++] = myI2CGPS.read(); // Capture the checksum
break;
}
}
NMEAsentence[bNMEAindex] = NULL;
if(bNMEAindex != 74) // I know a well formed $GNRMC valid sentence is 74
{
Serial.println(bNMEAindex);
};
Serial.println(NMEAsentence);
}
}
I bought the GPS from Cool Components. They call it their GPS Breakout - XA1110. They also give what I guess to be their part number - GPS-14414. In their support documentation they provide a datasheet for Titan X1 GPS. I am satisfied that the buffer GPS side of the TWI is much bigger than 32 bytes. I think I have seen it's 1k or .5k, but can't lay hands on my reference. Anyway, I am satisfied it's big enough to hold several sentences because I can pull quite a few if it has been powered up before I start. The upside of that is I can ignore the GPS for a second or so, & catch up with what's in its buffer in my own time. In any event, my test program isn't talking to the LCD, so that's not the problem. Test program runs monitor at 250 kbps. Same symptoms whether that or 9600.
Here's an extract of my monitor output.
3:21:12.551 -> $GNRMC,122113.000,A,5051.176925,N,00100.473457,W,1.30,123.78,210823,,,A*6F
13:21:13.576 -> 73
13:21:13.576 -> $GNRMC,122114.000,A,5051.176913,N,00100.473920,W,0.79,13.78,210823,,,A*6C
13:21:14.572 -> 73
13:21:14.572 -> $GNRMC122115.000,A,5051.176926,N,00100.474218,W,0.59,123.78,210823,,,A*6E
13:21:15.567 -> $GNRMC,122116.000,A,5051.177098,N,00100.474691,W,0.18,123.78,210823,,,A*60
13:21:16.563 -> $GNRMC,122117.000,A,5051.177087,N,00100.475307,W,0.26,123.78,210823,,,A*69
13:21:17.548 -> $GNRMC,122118.000,A,5051.177106,N,00100.475942,W,0.29,123.78,210823,,,A*6A
13:21:18.588 -> $GNRMC,122119.000,A,5051.176843,N,00100.476257,W,0.59,123.78,210823,,,A*69
13:21:19.573 -> 73
13:21:19.573 -> $GNRMC,122120.000,A,5051.176506N,00100.476928,W,0.48,123.78,210823,,,A*6C
13:21:20.556 -> $GNRMC,122121.000,A,5051.176677,N,00100.476227,W,0.48,123.78,210823,,,A*6C
13:21:21.531 -> $GNRMC,122122.000,A,5051.176544,N,00100.476028,W,0.90,123.78,210823,,,A*64
13:21:22.543 -> $GNRMC,122123.000,A,5051.176521,N,00100.475911,W,0.37,123.78,210823,,,A*6B
13:21:23.589 -> $GNRMC,122124.000,A,5051.176673,N,00100.476127,W,0.16,123.78,210823,,,A*65
13:21:24.553 -> $GNRMC,122125.000,A,5051.176633,N,00100.476105,W,0.39,123.78,210823,,,A*6D
13:21:25.570 -> $GNRMC,122126.000,A,5051.176743,N,00100.476152,W,0.42,123.78,210823,,,A*66
13:21:26.601 -> 73
13:21:26.601 -> $GNRMC,122127.000,A,5051.176643,N,00100.476225,W,0.38,123.78,210823,,A*68
13:21:27.577 -> 73
13:21:27.577 -> $GNRMC,122128.000,A,501.176669,N,00100.476427,W,0.19,123.78,210823,,,A*68
13:21:28.564 -> $GNRMC,122129.000,A,5051.176634,N,00100.476827,W,0.45,123.78,210823,,,A*64
13:21:29.584 -> $GNRMC,122130.000,A,5051.176627,N,00100.477077,W,0.58,123.78,210823,,,A*6E
13:21:30.517 -> $GNRMC,122131.000,A,5051.176477,N,00100.477491,W,0.61,123.78,210823,,,A*6E
13:21:31.540 -> $GNRMC,122132.000,A,5051.176406,N,00100.477711,W,0.59,123.78,210823,,,A*6B
13:21:32.573 -> $GNRMC,122133.000,A,5051.176482,N,00100.477886,W,0.38,123.78,210823,,,A*60
13:21:33.559 -> $GNRMC,122134.000,A,5051.176566,N,00100.478115,W,0.36,123.78,210823,,,A*6E
13:21:34.587 -> $GNRMC,122135.000,A,5051.176860,N,00100.478744,W,0.07,123.78,210823,,,A*64
13:21:35.559 -> $GNRMC,122136.000,A,5051.177194,N,00100.479717,W,0.81,123.78,210823,,,A*6D
13:21:36.535 -> $GNRMC,122137.000,A,5051.177158,N,00100.480739,W,0.87,293.00,210823,,,A*67
13:21:37.580 -> 73
13:21:37.580 -> $GNRMC,122138.000,A,5051.177364,N,00100.481151,W,0.61,336.16,21823,,,A*6D
13:21:38.583 -> $GNRMC,122139.000,A,5051.177534,N,00100.481876,W,0.82,304.34,210823,,,A*6F
13:21:39.564 -> $GNRMC,122140.000,A,5051.177736,N,00100.482088,W,0.41,304.34,210823,,,A*64