Problem detecting GPS input
Archiver
Posts: 46,084
It ain't much fun to be a script kiddie newbie and ask what is
probably an embarrassing question, but I'll try to grin and bear it!
Using HyperTerminal, I confirmed that my old Magellan Meridian GPS is
pumping out a reliable & properly formatted NMEA RMC sentence (and
nothing else) at 4800bps 8N1 every couple of seconds. I don't have
an o-scope, but my digital VOM suggests each GPS sentence is output
at 3.5vdc. I put the GPS+ signal into I/O pin 0 (P0 or physical pin
5), and I put the GPS- into VSS on an unpowered P40 demo board
(BS2p40). Unexpectedly, the P40 board's LED began to flicker every
couple of seconds. Then I powered-up the board, loaded Jon Williams'
N&V Mar2002 article #83 on GPS data display, clicked on run, and got
repeated error messages "No GPS data detected."
I expected no altitude display, but I can't explain why the stamp
doesn't see the GPS data coming in.
Jon's program features scratchpad RAM and does some pretty fancy
parsing, conversions of ASCII data to numeric values, and screen
formatting that I at least partially understand. But needing to
crawl before I walk, I'd be happy to just see the scratchpad RAM
displayed or learn syntax to save the unparsed string to add-on flash
memory.
I've tried varying the SERIN wait period, but that didn't help. I
wonder if the GPS voltage is too low. Probably, I'm missing
something terribly obvious. If so, after a good chuckle at my
expense, I would appreciate advice on how to recognize the GPS data
stream.
Hank
probably an embarrassing question, but I'll try to grin and bear it!
Using HyperTerminal, I confirmed that my old Magellan Meridian GPS is
pumping out a reliable & properly formatted NMEA RMC sentence (and
nothing else) at 4800bps 8N1 every couple of seconds. I don't have
an o-scope, but my digital VOM suggests each GPS sentence is output
at 3.5vdc. I put the GPS+ signal into I/O pin 0 (P0 or physical pin
5), and I put the GPS- into VSS on an unpowered P40 demo board
(BS2p40). Unexpectedly, the P40 board's LED began to flicker every
couple of seconds. Then I powered-up the board, loaded Jon Williams'
N&V Mar2002 article #83 on GPS data display, clicked on run, and got
repeated error messages "No GPS data detected."
I expected no altitude display, but I can't explain why the stamp
doesn't see the GPS data coming in.
Jon's program features scratchpad RAM and does some pretty fancy
parsing, conversions of ASCII data to numeric values, and screen
formatting that I at least partially understand. But needing to
crawl before I walk, I'd be happy to just see the scratchpad RAM
displayed or learn syntax to save the unparsed string to add-on flash
memory.
I've tried varying the SERIN wait period, but that didn't help. I
wonder if the GPS voltage is too low. Probably, I'm missing
something terribly obvious. If so, after a good chuckle at my
expense, I would appreciate advice on how to recognize the GPS data
stream.
Hank
Comments
NMEA0183 is I think what he intended that for. Basically just means that
the output string is sent with a different ordering or control characters.
And was it RTCM that you were talking about?
Original Message
From: "Henry Williams" <tohbw@s...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, June 06, 2004 12:47 AM
Subject: [noparse][[/noparse]basicstamps] Problem detecting GPS input
> It ain't much fun to be a script kiddie newbie and ask what is
> probably an embarrassing question, but I'll try to grin and bear it!
>
> Using HyperTerminal, I confirmed that my old Magellan Meridian GPS is
> pumping out a reliable & properly formatted NMEA RMC sentence (and
> nothing else) at 4800bps 8N1 every couple of seconds. I don't have
> an o-scope, but my digital VOM suggests each GPS sentence is output
> at 3.5vdc. I put the GPS+ signal into I/O pin 0 (P0 or physical pin
> 5), and I put the GPS- into VSS on an unpowered P40 demo board
> (BS2p40). Unexpectedly, the P40 board's LED began to flicker every
> couple of seconds. Then I powered-up the board, loaded Jon Williams'
> N&V Mar2002 article #83 on GPS data display, clicked on run, and got
> repeated error messages "No GPS data detected."
>
> I expected no altitude display, but I can't explain why the stamp
> doesn't see the GPS data coming in.
>
> Jon's program features scratchpad RAM and does some pretty fancy
> parsing, conversions of ASCII data to numeric values, and screen
> formatting that I at least partially understand. But needing to
> crawl before I walk, I'd be happy to just see the scratchpad RAM
> displayed or learn syntax to save the unparsed string to add-on flash
> memory.
>
> I've tried varying the SERIN wait period, but that didn't help. I
> wonder if the GPS voltage is too low. Probably, I'm missing
> something terribly obvious. If so, after a good chuckle at my
> expense, I would appreciate advice on how to recognize the GPS data
> stream.
>
> Hank
>
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
accurately stated NMEA 0183 "RMC" sentence, which is indeed what
Jon's clever Mar02 #83 article/program was designed to parse and
display.
Paraphrased from my GPS manual: The National Marine Electronics
Association (NMEA) has defined 8 or more standard formats to
interface with other marine devices. These standards include the
APA, APB, WBWC, GCA, GLL, RMB, RMC, VTG comma delimited sentences,
each starting with a header ID string. Just for the sake of an
example, the shortest sentence is the BWC format, which only reports
range and bearing to a previously defined waypoint (lat/lon). The
RMC sentence is the most logical to use for time/lat/lon/course/speed
because almost all the included data is relevant.
Depending on a GPS's make and model, one or more NMEA sentences can
be produced in various order. That is why Jon's SERIN waits until it
sees part of the "RMC" header, because several different variable
length sentences might burst out one right after another. In the
case of my old Magellan, I can setup the output to be a combination
of several sentences and baud rates from 1200 to 19200. The Meridian
manual told me that the options I selected would burst a RMC and an
RMB sentence at 4800. But when I looked at the output in
HyperTerminal, in fact, only the RMC sentence was coming out every 2
seconds. Oh well, RMC is all I wanted anyway.
In addition to standard NMEA sentences, many GPS put out custom
sentences such as the Garmin Etrex altitude string mentioned in
article #83, and the proprietary 9600baud sentence Jon used in his
Nov03 article #103.
Back to the fundamental problem that I hope someone can help solve: I
can't get my BS2p40 to recognize the data input.
For some reason, my BS2p40 isn't seeing the data stream so Jon's
program times-out and displays a repetitive message "Error: No GPS
data detected."
Today, continuing to think that the data packet's voltage might be
too low for BS2p logic, I thought it might help to change the GPS
from internal power (about 4.2 volts from 3 penlight batteries) to a
car battery (13.8 volts). Sadly, the NMEA output voltage remained
unchanged, sometimes hitting 3.2 volts, but usually around 2 or even
1.7 volts. Obviously this is enough of a voltage swing for
HyperTerminal to pick up and repetitively display the string without
any glitches. However, the BS2p doesn't react.
If a low voltage signal is the problem (just a wag), I am unsure how
it could be amplified without more effort than it is worth. Tomorrow
I hope to try a different GPS and see what happens.
"SB" <steve.brady@r...> wrote:
> NMEA RMC?? I didn't think that's what john wrote the prog for.
>
> NMEA0183 is I think what he intended that for. Basically just
means that
> the output string is sent with a different ordering or control
characters.
>
> And was it RTCM that you were talking about?
If you're not getting what's expected, it may help to determine what
you are getting. Perhaps a simpler starting place:
'{$STAMP BS2p}
pin CON 1 (or whatever)
gps_data VAR Byte(20)
SERIN pin,500,[noparse][[/noparse]STR gps_data \19]
DEBUG STR gps_data
The above assumes non-inverted at 4800 baud. When you fed the data
to hyperterminal, did you use a level converter (MAX232 or similar)?
If not, then your GPS is sending the serial data inverted, and you'll
need 16884 for baudmode instead and no level converter between your
GPS and Stamp.
Also, it's likely your GPS will not generate GPRMB messages unless
you have an active destination waypoint, so that's probably why
you're not seeing those sentences.
Regards,
Steve
data to the scratchpad
'{$STAMP BS2P}
'{PBASIC 2.5}
X VAR Byte
I VAR Byte
DO
SERIN 0,16884,[noparse][[/noparse]wait("RMC,"),SPSTR 30]
FOR I=0 to 29
GET I,X
DEBUG X
NEXT
LOOP
That would wait forever to the "RMC" to arrive, then captures 30
bytes to the scratchpad, then shows it. The baudmode for the BS2P is
4800 baud inverted. It sounds like you are going directly into pin
P0 without an inverting driver. That is fine and should work with
3.5 volts, but I would still put a 10kohm resistor in series between
the GPS and the pin. Maybe the GPS is taking the voltage negative
and locking up the pin. A voltmeter is not a very good indicator of
the peak voltage. The fact that the LED flickers without the power
applied means (1) the GPS sentence is coming through and (2) it has
found a "sneak" path into your power supply.
Once you get some satisfaction with a simple program, adjust the
number of characters in the SPSTR to capture the GPS parameters you
need.
-- Tracy
>It ain't much fun to be a script kiddie newbie and ask what is
>probably an embarrassing question, but I'll try to grin and bear it!
>
>Using HyperTerminal, I confirmed that my old Magellan Meridian GPS is
>pumping out a reliable & properly formatted NMEA RMC sentence (and
>nothing else) at 4800bps 8N1 every couple of seconds. I don't have
>an o-scope, but my digital VOM suggests each GPS sentence is output
>at 3.5vdc. I put the GPS+ signal into I/O pin 0 (P0 or physical pin
>5), and I put the GPS- into VSS on an unpowered P40 demo board
>(BS2p40). Unexpectedly, the P40 board's LED began to flicker every
>couple of seconds. Then I powered-up the board, loaded Jon Williams'
>N&V Mar2002 article #83 on GPS data display, clicked on run, and got
>repeated error messages "No GPS data detected."
>
>I expected no altitude display, but I can't explain why the stamp
>doesn't see the GPS data coming in.
>
>Jon's program features scratchpad RAM and does some pretty fancy
>parsing, conversions of ASCII data to numeric values, and screen
>formatting that I at least partially understand. But needing to
>crawl before I walk, I'd be happy to just see the scratchpad RAM
>displayed or learn syntax to save the unparsed string to add-on flash
>memory.
>
>I've tried varying the SERIN wait period, but that didn't help. I
>wonder if the GPS voltage is too low. Probably, I'm missing
>something terribly obvious. If so, after a good chuckle at my
>expense, I would appreciate advice on how to recognize the GPS data
>stream.
>
>Hank
good GPS serial output using program code published in the Mar2002
Nuts & Volts.
--- In basicstamps@yahoogroups.com, "S Parkis" <parkiss@e...> wrote:
> Henry-
>
> If you're not getting what's expected, it may help to determine
> what you are getting. Perhaps a simpler starting place:
>
> '{$STAMP BS2p}
> pin CON 1 (or whatever)
> gps_data VAR Byte(20)
>
> SERIN pin,500,[noparse][[/noparse]STR gps_data \19]
> DEBUG STR gps_data
>
> The above assumes non-inverted at 4800 baud. When you fed the data
> to hyperterminal, did you use a level converter (MAX232 or
> similar)? If not, then your GPS is sending the serial data
> inverted, and you'll need 16884 for baudmode instead and no level
> converter between your GPS and Stamp.
>
> Also, it's likely your GPS will not generate GPRMB messages unless
> you have an active destination waypoint, so that's probably why
> you're not seeing those sentences.
>
> Regards,
>
> Steve
Thanks Steve, I'll give your suggested code a try tonight.
As to your question about how I injected data into HypterTerminal:
I just ran NMEA+ & - directly into the serial port. Once I validated
the GPS was transmitting data, I put put NMEA+ to Stamp P0, and NMEA-
to Stamp VSS on the unpowered demo board, which made the LED blink
every 2 seconds. Then I powered up the board and ran the program,
but no GPS data was found. I spent quite a bit of time looking
through message archives on GPS and saw other comments about inverted
serial data, but the subject confuses me so far. However, Jon's code
(about line 54) does include a baudmode 16884.
As to not getting a RMB message, yup, I had no waypoint defined.
I should not have overlooked the sentance content, 12 of the 14 data
fields are dependent on a waypoint which was not defined, no wonder
the GPS wasn't producing this sentance. [noparse]:)[/noparse] I was so pleased just to
see the RMC sentance, I pressed on to the Stamp!
Hank
serin some string data just to see what might be coming in.
I don't recall how to serin stuff (I'm on the road and without the
documentation) but see if your stamp is receiving anything....your GPS prog
just might not be seeing what it wants (I'm guessing there's a WAIT
statement in the serin line!
Original Message
From: "Henry Williams" <tohbw@s...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, June 06, 2004 10:19 PM
Subject: [noparse][[/noparse]basicstamps] Re: Problem detecting GPS input
> Thanks for taking time to respond, Steve. I should have more
> accurately stated NMEA 0183 "RMC" sentence, which is indeed what
> Jon's clever Mar02 #83 article/program was designed to parse and
> display.
>
> Paraphrased from my GPS manual: The National Marine Electronics
> Association (NMEA) has defined 8 or more standard formats to
> interface with other marine devices. These standards include the
> APA, APB, WBWC, GCA, GLL, RMB, RMC, VTG comma delimited sentences,
> each starting with a header ID string. Just for the sake of an
> example, the shortest sentence is the BWC format, which only reports
> range and bearing to a previously defined waypoint (lat/lon). The
> RMC sentence is the most logical to use for time/lat/lon/course/speed
> because almost all the included data is relevant.
>
> Depending on a GPS's make and model, one or more NMEA sentences can
> be produced in various order. That is why Jon's SERIN waits until it
> sees part of the "RMC" header, because several different variable
> length sentences might burst out one right after another. In the
> case of my old Magellan, I can setup the output to be a combination
> of several sentences and baud rates from 1200 to 19200. The Meridian
> manual told me that the options I selected would burst a RMC and an
> RMB sentence at 4800. But when I looked at the output in
> HyperTerminal, in fact, only the RMC sentence was coming out every 2
> seconds. Oh well, RMC is all I wanted anyway.
>
> In addition to standard NMEA sentences, many GPS put out custom
> sentences such as the Garmin Etrex altitude string mentioned in
> article #83, and the proprietary 9600baud sentence Jon used in his
> Nov03 article #103.
>
>
>
>
> Back to the fundamental problem that I hope someone can help solve: I
> can't get my BS2p40 to recognize the data input.
>
> For some reason, my BS2p40 isn't seeing the data stream so Jon's
> program times-out and displays a repetitive message "Error: No GPS
> data detected."
>
> Today, continuing to think that the data packet's voltage might be
> too low for BS2p logic, I thought it might help to change the GPS
> from internal power (about 4.2 volts from 3 penlight batteries) to a
> car battery (13.8 volts). Sadly, the NMEA output voltage remained
> unchanged, sometimes hitting 3.2 volts, but usually around 2 or even
> 1.7 volts. Obviously this is enough of a voltage swing for
> HyperTerminal to pick up and repetitively display the string without
> any glitches. However, the BS2p doesn't react.
>
> If a low voltage signal is the problem (just a wag), I am unsure how
> it could be amplified without more effort than it is worth. Tomorrow
> I hope to try a different GPS and see what happens.
>
> "SB" <steve.brady@r...> wrote:
>
> > NMEA RMC?? I didn't think that's what john wrote the prog for.
> >
> > NMEA0183 is I think what he intended that for. Basically just
> means that
> > the output string is sent with a different ordering or control
> characters.
> >
> > And was it RTCM that you were talking about?
>
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>