Hi all,
I'm working on a copy of the "Frustromantic Box" (http://newbrightidea.com/?p=63) and I'm running into trouble getting useful GPS data out of the module.
I've got a bit of test code my friend found (I can't find the original source):
#define bit9600Delay 84
#define halfBit9600Delay 42
#define bit4800Delay 188
#define halfBit4800Delay 94
...
char SWread()
{
byte val = 0;
while (digitalRead(rx)); //wait for start bit
if (digitalRead(rx) == LOW) {
delayMicroseconds(halfBit9600Delay);
for (int offset = 0; offset < 8; offset++) {
delayMicroseconds(bit9600Delay);
val |= digitalRead(rx) << offset;
}
//wait for stop bit + extra
delayMicroseconds(bit9600Delay);
delayMicroseconds(bit9600Delay);
return val;
}
}
I don't have much information to give other than:
-
GPS light is almost always steady on (manual says this means it's searching). Occasionally it will blink (position lock). I've got nothing but the sky above me, so I don't know why it wouldn't find a signal, I'll just assume that it is.
-
I'm pretty sure the GPS is outputting at 9600 baud, 8 data bits, 0 stop, no parity. However, this little sample code above only shows stuff when I set it to listen at 4800 baud... I've played around with the two delay statements near the end, trying neither, one, or both to see if I've got the stop or parity bit wrong, but to no avail.
-
The output from this sample code looks quite irregular (it doesn't parse NMEA, but the raw stuff doesn't look valid). In hex, I'm getting stuff like FFFFFF93 FFFFFF98 26 2F 6 16 2C D 19 2C 19 6C 19 78 but it repeats forever (not the same string) without any regular structure.
-
All I know from the frustromantic code is that the gps library isn't reading valid NMEA data.
Not much to go on, I'm afraid, but maybe there's a chance somebody recognizes what problem causes nasty output like this?
Thanks!
FFFFFFB3 63 FFFFFFE5 FFFFFFFE 64 34 FFFFFF87 73 FFFFFF9B FFFFFF97 19 2C 19 30 19 70 19 6C 1A 30 19 6C 1A 6C 33 30 33 75 FFFFFFB3 FFFFFF83 FFFFFF96 19 6C 19 6C 19 2C 19 6C 19 6C FFFFFF99