PDA

View Full Version : Zx4120 Gps



barkerben
- 10th November 2005, 23:18
Hi,

I'm using a ZX4120 GPS module in a project. There is a pin which should, according to the data sheet, stay high unti a fix is ound, then go low.

In fact, until a fix is found the output is periodic, roughly 50% mark space high (2.7v)/low.

Once a fix is found, the voltage is still unstable, but much lower - the maximum voltage is < Logic High for the pic, so that is ok.

Has anyone else had this problem? I could put a capacitor is series with a resistor and diode across the port, then a disharge resistor in paralell. Thus the voltage would stay high, charging current would be low, and when the pin went low the capacitor would disharge and the pin go low.But it seems a bit cumbersome. Any ideas?

Cheers,

Ben

barkerben
- 11th November 2005, 21:28
Ok...I talked to crownhill, and apparently it's supposed to be a square wave to flash an LED. Grrr... I put a capacitor smoothing circuit across the pin, and that gave me a nice steady logic level. But unfortunately when the GPS pin goes low, it has the ocassional burst of 1v, which is enough to keep the capacitor charged, so the voltage never falls.

Any ideas?

Ben

Ron Marcus
- 13th November 2005, 03:38
Any ideas?

Ben

Don't use it?
I use the Lassen IQ unit. Since the position of data changes when there is a lock, I test a certain position for a known variable...ie. IF it is "N" or "S" in position nine. It works great, and can be changed as needed. Saves hardware also.

Hope this helps,
Ron

barkerben
- 13th November 2005, 10:51
Thanks - In fact, i'm doing smething similar. I haven't had a chance to test out my NMEA parsing code yet - I've tried to use only fixed width sentances, so I don't have to read in the entire sentance. Bit confused about the capabilities of the DEC modifier though, so will wait and see when I have a moment to program it up...:-)

Cheers,

Ben

Ron Marcus
- 13th November 2005, 12:28
Thanks - In fact, i'm doing something similar. I haven't had a chance to test out my NMEA parsing code yet -
Ben

The "wait" and "skip" modifiers are absolute gold! What I originally did not understand, was that they could be used as many times in a statement as need be. I used wait for the "GPGGA" then counted past what I didn't want, threw it in a variable, skipped a little more, another variable or two,.... You get the picture. Below is a line from the code......

serin2 GPS_in,baud,[wait("$GPGGA,"),skip 10,str lat\8,skip 2,str ns\1,skip 1,str long\9,skip 2,str ew\1]

The output was sent to a 16F818 which I used to convert the data into an on screen display overlayed on a video camera signal. Therefore I only had need for the data in ASCII form. I just added a LM 1881 sync seperator, and a couple of gate chips for clock syncing. You could use the DEC modifier just as easily.

Ron

barkerben
- 13th November 2005, 12:58
Thanks - that's what I thought.

What I was unsure about was the exact behaviour of these modifiers. For instance, I assume the DEC modifier (not using dec2, dec3 etc) will read numeric characters for as long as they keep coming in. So 123ABC would read 123, 12AB would just read 12.

But what happens I wonder if there are no numeric characters? If I tell the PIC to wait until the string "foo" is seen, then read in a 3 digit value, but there is no three digit value present, will it just keep on waiting until there is?

This becomes an issue as when no fix is present, some of the NMEA fields collapse into ,,, with no numeric values to read in. Not that it really matters, as long as I can identify them as bogus!

so waiting for "foo", foo123 will read in 123. But fooabcde123 will do what I wonder? I guess the only way to find out is to try :-)