Shop OBEX P1 Docs P2 Docs Learn Events
At wits end reading NMEA GPS sentence — Parallax Forums

At wits end reading NMEA GPS sentence

ArchiverArchiver Posts: 46,084
edited 2004-06-04 01:01 in General Discussion
I am trying to read NMEA data being transmitted from a Garmin 35-PC
GPS unit which is sending a standard GRMC sentence every second at
4800 baud to my BS2p40 via a max232 chip. The GPS transmits fine to
my windows Hyper Terminal so I know it's working fine. However when I
try to read the data in the BS2p40 I get junk data (looks like an
eastern european language). I have reviewed the electronics
scrupulously and know my Max232 and its associated caps are set up
correctly (the data enters pin 13 and exits pin 12). I think it must
be the code. I'm just using some simple code shown below.

' {$STAMP BS2p}
MyByte VAR Byte
PAUSE 250
DEBUG CLS
Main:
SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
DEBUG MyByte
GOTO Main

No_GPS_Data:
DEBUG "No Data"
GOTO Main


I also tried replacing the above SERIN command with:

SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]

and the program just hangs waiting.

I've tried just about everything and after several days of
frustration I am hoping someone can point me in the right direction.

Kind Regards,
Eric

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 18:42
    Maybe your data is getting double inverted. Remove your MAX232 or
    change the baud rate parameter to 500 for 4800 baud on the BS2p.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=WA6vKX_wcHQj7NgoYhVYjurWNHW3pNNrPjEJplti6WKfAYIElF1O_xSXiP_aOgQVlIJd3Z-6tKEANQ]khufumen@y...[/url
    Sent: Tuesday, June 01, 2004 12:33 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS sentence


    I am trying to read NMEA data being transmitted from a Garmin 35-PC
    GPS unit which is sending a standard GRMC sentence every second at
    4800 baud to my BS2p40 via a max232 chip. The GPS transmits fine to
    my windows Hyper Terminal so I know it's working fine. However when I
    try to read the data in the BS2p40 I get junk data (looks like an
    eastern european language). I have reviewed the electronics
    scrupulously and know my Max232 and its associated caps are set up
    correctly (the data enters pin 13 and exits pin 12). I think it must
    be the code. I'm just using some simple code shown below.

    ' {$STAMP BS2p}
    MyByte VAR Byte
    PAUSE 250
    DEBUG CLS
    Main:
    SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    DEBUG MyByte
    GOTO Main

    No_GPS_Data:
    DEBUG "No Data"
    GOTO Main


    I also tried replacing the above SERIN command with:

    SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]

    and the program just hangs waiting.

    I've tried just about everything and after several days of
    frustration I am hoping someone can point me in the right direction.

    Kind Regards,
    Eric
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 18:55
    Jon,

    I tried the 500 baud rate parameter as well as every
    other one listed for the BS2p with no effect. I have
    the max232 there to convert the incoming GPS data from
    RS232 levels to TTL levels. Wouldn't the stamp get
    hurt if I fed the signal directly to the pin?

    Eric



    --- Jon Williams <jwilliams@p...> wrote:
    > Maybe your data is getting double inverted. Remove
    > your MAX232 or
    > change the baud rate parameter to 500 for 4800 baud
    > on the BS2p.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=mROAU0Xx4temlRKW7P66V6tDzRwdlsKFvz7bz5GxUmHOh8VvTwFDMOOhxttifwquat6ICFqJwO5d57EoxQ]khufumen@y...[/url
    > Sent: Tuesday, June 01, 2004 12:33 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS
    > sentence
    >
    >
    > I am trying to read NMEA data being transmitted from
    > a Garmin 35-PC
    > GPS unit which is sending a standard GRMC sentence
    > every second at
    > 4800 baud to my BS2p40 via a max232 chip. The GPS
    > transmits fine to
    > my windows Hyper Terminal so I know it's working
    > fine. However when I
    > try to read the data in the BS2p40 I get junk data
    > (looks like an
    > eastern european language). I have reviewed the
    > electronics
    > scrupulously and know my Max232 and its associated
    > caps are set up
    > correctly (the data enters pin 13 and exits pin 12).
    > I think it must
    > be the code. I'm just using some simple code shown
    > below.
    >
    > ' {$STAMP BS2p}
    > MyByte VAR Byte
    > PAUSE 250
    > DEBUG CLS
    > Main:
    > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    > DEBUG MyByte
    > GOTO Main
    >
    > No_GPS_Data:
    > DEBUG "No Data"
    > GOTO Main
    >
    >
    > I also tried replacing the above SERIN command with:
    >
    > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"),
    > SPSTR 65]
    >
    > and the program just hangs waiting.
    >
    > I've tried just about everything and after several
    > days of
    > frustration I am hoping someone can point me in the
    > right direction.
    >
    > Kind Regards,
    > Eric
    >
    >
    > 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
    >
    >
    > basicstamps-unsubscribe@yahoogroups.com
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 19:21
    If you have an RS-232 level signal then you can feed it to the BASIC
    Stamp through a 22K resistor (protects the pin if it accidentally gets
    made an output). I've done this with serial devices on several
    occasions. Honestly, I don't know why you're having problems. I've
    used the Garmin eTrex in more than a few projects and have never had any
    difficulty with it. I know you're using a different model, but you
    should still have success.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YObdy4loq_PlfnbIuQqODzLs7lDKeVnSFAM4r002PSYHDgNm6A7kniEe-5CND_fKC-gvaiXf851Ndh4Txg]khufumen@y...[/url
    Sent: Tuesday, June 01, 2004 12:55 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS sentence


    Jon,

    I tried the 500 baud rate parameter as well as every
    other one listed for the BS2p with no effect. I have
    the max232 there to convert the incoming GPS data from
    RS232 levels to TTL levels. Wouldn't the stamp get
    hurt if I fed the signal directly to the pin?

    Eric



    --- Jon Williams <jwilliams@p...> wrote:
    > Maybe your data is getting double inverted. Remove
    > your MAX232 or
    > change the baud rate parameter to 500 for 4800 baud
    > on the BS2p.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YObdy4loq_PlfnbIuQqODzLs7lDKeVnSFAM4r002PSYHDgNm6A7kniEe-5CND_fKC-gvaiXf851Ndh4Txg]khufumen@y...[/url
    > Sent: Tuesday, June 01, 2004 12:33 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS
    > sentence
    >
    >
    > I am trying to read NMEA data being transmitted from
    > a Garmin 35-PC
    > GPS unit which is sending a standard GRMC sentence
    > every second at
    > 4800 baud to my BS2p40 via a max232 chip. The GPS
    > transmits fine to
    > my windows Hyper Terminal so I know it's working
    > fine. However when I
    > try to read the data in the BS2p40 I get junk data
    > (looks like an
    > eastern european language). I have reviewed the
    > electronics
    > scrupulously and know my Max232 and its associated
    > caps are set up
    > correctly (the data enters pin 13 and exits pin 12).
    > I think it must
    > be the code. I'm just using some simple code shown
    > below.
    >
    > ' {$STAMP BS2p}
    > MyByte VAR Byte
    > PAUSE 250
    > DEBUG CLS
    > Main:
    > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    > DEBUG MyByte
    > GOTO Main
    >
    > No_GPS_Data:
    > DEBUG "No Data"
    > GOTO Main
    >
    >
    > I also tried replacing the above SERIN command with:
    >
    > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"),
    > SPSTR 65]
    >
    > and the program just hangs waiting.
    >
    > I've tried just about everything and after several
    > days of
    > frustration I am hoping someone can point me in the
    > right direction.
    >
    > Kind Regards,
    > Eric
    >
    >
    > 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
    >
    >
    > basicstamps-unsubscribe@yahoogroups.com
    >
    >
    >



    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







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 19:58
    Jon,
    Hurray!! It works!!! I used the 22K resistor like you
    suggested and its working fine.

    Last question. If I want to send data to the GPS unit
    (ie. to control what NMEA sentences it outputs) can I
    transmit directly from the stamp or do I need to go
    through a Max232? The GPS unit is about 6 feet away
    from the BS2p40 stamp.

    Thanks a ton.

    Eric


    --- Jon Williams <jwilliams@p...> wrote:
    > If you have an RS-232 level signal then you can feed
    > it to the BASIC
    > Stamp through a 22K resistor (protects the pin if it
    > accidentally gets
    > made an output). I've done this with serial devices
    > on several
    > occasions. Honestly, I don't know why you're having
    > problems. I've
    > used the Garmin eTrex in more than a few projects
    > and have never had any
    > difficulty with it. I know you're using a different
    > model, but you
    > should still have success.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=m9HweX9wRB1PoLIYyecCAnhFYBkjLvwDksmUGbQBZrVcA-gcbVHSAFItJncy3qwtHdQfgisCkkU]khufumen@y...[/url
    > Sent: Tuesday, June 01, 2004 12:55 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] At wits end reading NMEA
    > GPS sentence
    >
    >
    > Jon,
    >
    > I tried the 500 baud rate parameter as well as every
    > other one listed for the BS2p with no effect. I have
    > the max232 there to convert the incoming GPS data
    > from
    > RS232 levels to TTL levels. Wouldn't the stamp get
    > hurt if I fed the signal directly to the pin?
    >
    > Eric
    >
    >
    >
    > --- Jon Williams <jwilliams@p...> wrote:
    > > Maybe your data is getting double inverted.
    > Remove
    > > your MAX232 or
    > > change the baud rate parameter to 500 for 4800
    > baud
    > > on the BS2p.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=m9HweX9wRB1PoLIYyecCAnhFYBkjLvwDksmUGbQBZrVcA-gcbVHSAFItJncy3qwtHdQfgisCkkU]khufumen@y...[/url
    > > Sent: Tuesday, June 01, 2004 12:33 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA
    > GPS
    > > sentence
    > >
    > >
    > > I am trying to read NMEA data being transmitted
    > from
    > > a Garmin 35-PC
    > > GPS unit which is sending a standard GRMC sentence
    > > every second at
    > > 4800 baud to my BS2p40 via a max232 chip. The GPS
    > > transmits fine to
    > > my windows Hyper Terminal so I know it's working
    > > fine. However when I
    > > try to read the data in the BS2p40 I get junk data
    > > (looks like an
    > > eastern european language). I have reviewed the
    > > electronics
    > > scrupulously and know my Max232 and its associated
    > > caps are set up
    > > correctly (the data enters pin 13 and exits pin
    > 12).
    > > I think it must
    > > be the code. I'm just using some simple code shown
    > > below.
    > >
    > > ' {$STAMP BS2p}
    > > MyByte VAR Byte
    > > PAUSE 250
    > > DEBUG CLS
    > > Main:
    > > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    > > DEBUG MyByte
    > > GOTO Main
    > >
    > > No_GPS_Data:
    > > DEBUG "No Data"
    > > GOTO Main
    > >
    > >
    > > I also tried replacing the above SERIN command
    > with:
    > >
    > > SERIN 0, 16884, 1500, No_GPS_Data,
    > [noparse][[/noparse]WAIT("GPRMC,"),
    > > SPSTR 65]
    > >
    > > and the program just hangs waiting.
    > >
    > > I've tried just about everything and after several
    > > days of
    > > frustration I am hoping someone can point me in
    > the
    > > right direction.
    > >
    > > Kind Regards,
    > > Eric
    > >
    > >
    > > 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
    > >
    > >
    > > basicstamps-unsubscribe@yahoogroups.com
    > >
    > >
    > >
    >
    >
    >
    > 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
    >
    >
    >
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please
    > report SPAM to
    > abuse@p....
    >
    >
    >
    > 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
    >
    >
    > basicstamps-unsubscribe@yahoogroups.com
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 20:44
    Actually, with a 22Kohm resistor in series, the
    Stamp quite happily can recieve RS-232 signals.
    The Stamp has internal clamping diodes which
    prevent damage to the pins in this case.

    It can't SEND this way, of course.

    What Jon was saying is there is an 'Invert' option
    in the baud-rate selector ($4000). With a MAX232,
    you need to select 'Invert'. With a 22Kohm resistor,
    you don't select 'Invert'. Or, vice-versa, I've
    not yet seen a definitive answer to when you need
    invert and when not.

    However, when using "Pin 16", I ALWAYS use the
    Invert option.

    --- In basicstamps@yahoogroups.com, Eric <khufumen@y...> wrote:
    > Jon,
    >
    > I tried the 500 baud rate parameter as well as every
    > other one listed for the BS2p with no effect. I have
    > the max232 there to convert the incoming GPS data from
    > RS232 levels to TTL levels. Wouldn't the stamp get
    > hurt if I fed the signal directly to the pin?
    >
    > Eric
    >
    >
    >
    > --- Jon Williams <jwilliams@p...> wrote:
    > > Maybe your data is getting double inverted. Remove
    > > your MAX232 or
    > > change the baud rate parameter to 500 for 4800 baud
    > > on the BS2p.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Eric Berg [noparse][[/noparse]mailto:khufumen@y...]
    > > Sent: Tuesday, June 01, 2004 12:33 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS
    > > sentence
    > >
    > >
    > > I am trying to read NMEA data being transmitted from
    > > a Garmin 35-PC
    > > GPS unit which is sending a standard GRMC sentence
    > > every second at
    > > 4800 baud to my BS2p40 via a max232 chip. The GPS
    > > transmits fine to
    > > my windows Hyper Terminal so I know it's working
    > > fine. However when I
    > > try to read the data in the BS2p40 I get junk data
    > > (looks like an
    > > eastern european language). I have reviewed the
    > > electronics
    > > scrupulously and know my Max232 and its associated
    > > caps are set up
    > > correctly (the data enters pin 13 and exits pin 12).
    > > I think it must
    > > be the code. I'm just using some simple code shown
    > > below.
    > >
    > > ' {$STAMP BS2p}
    > > MyByte VAR Byte
    > > PAUSE 250
    > > DEBUG CLS
    > > Main:
    > > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    > > DEBUG MyByte
    > > GOTO Main
    > >
    > > No_GPS_Data:
    > > DEBUG "No Data"
    > > GOTO Main
    > >
    > >
    > > I also tried replacing the above SERIN command with:
    > >
    > > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"),
    > > SPSTR 65]
    > >
    > > and the program just hangs waiting.
    > >
    > > I've tried just about everything and after several
    > > days of
    > > frustration I am hoping someone can point me in the
    > > right direction.
    > >
    > > Kind Regards,
    > > Eric
    > >
    > >
    > > 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
    > >
    > >
    > > basicstamps-unsubscribe@yahoogroups.com
    > >
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-01 22:27
    That part I don't know ... haven't tried it yet. Chances are with very
    short connections between the BASIC Stamp and the GPS unit you can get
    away with not using the MAX232.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=t1MnbjuMuf3M8XRpUkgtse16kmRHmnhxZrnjrKNOLkFTHKInNkl2QS9FxlfptnMc5ytlHAs4WrchCA]khufumen@y...[/url
    Sent: Tuesday, June 01, 2004 1:59 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] At wits end reading NMEA GPS sentence


    Jon,
    Hurray!! It works!!! I used the 22K resistor like you
    suggested and its working fine.

    Last question. If I want to send data to the GPS unit
    (ie. to control what NMEA sentences it outputs) can I
    transmit directly from the stamp or do I need to go
    through a Max232? The GPS unit is about 6 feet away
    from the BS2p40 stamp.

    Thanks a ton.

    Eric


    --- Jon Williams <jwilliams@p...> wrote:
    > If you have an RS-232 level signal then you can feed
    > it to the BASIC
    > Stamp through a 22K resistor (protects the pin if it accidentally gets
    > made an output). I've done this with serial devices
    > on several
    > occasions. Honestly, I don't know why you're having
    > problems. I've
    > used the Garmin eTrex in more than a few projects
    > and have never had any
    > difficulty with it. I know you're using a different
    > model, but you
    > should still have success.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=t1MnbjuMuf3M8XRpUkgtse16kmRHmnhxZrnjrKNOLkFTHKInNkl2QS9FxlfptnMc5ytlHAs4WrchCA]khufumen@y...[/url
    > Sent: Tuesday, June 01, 2004 12:55 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] At wits end reading NMEA
    > GPS sentence
    >
    >
    > Jon,
    >
    > I tried the 500 baud rate parameter as well as every
    > other one listed for the BS2p with no effect. I have
    > the max232 there to convert the incoming GPS data
    > from
    > RS232 levels to TTL levels. Wouldn't the stamp get
    > hurt if I fed the signal directly to the pin?
    >
    > Eric
    >
    >
    >
    > --- Jon Williams <jwilliams@p...> wrote:
    > > Maybe your data is getting double inverted.
    > Remove
    > > your MAX232 or
    > > change the baud rate parameter to 500 for 4800
    > baud
    > > on the BS2p.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=t1MnbjuMuf3M8XRpUkgtse16kmRHmnhxZrnjrKNOLkFTHKInNkl2QS9FxlfptnMc5ytlHAs4WrchCA]khufumen@y...[/url
    > > Sent: Tuesday, June 01, 2004 12:33 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] At wits end reading NMEA
    > GPS
    > > sentence
    > >
    > >
    > > I am trying to read NMEA data being transmitted
    > from
    > > a Garmin 35-PC
    > > GPS unit which is sending a standard GRMC sentence
    > > every second at
    > > 4800 baud to my BS2p40 via a max232 chip. The GPS
    > > transmits fine to
    > > my windows Hyper Terminal so I know it's working
    > > fine. However when I
    > > try to read the data in the BS2p40 I get junk data
    > > (looks like an
    > > eastern european language). I have reviewed the
    > > electronics
    > > scrupulously and know my Max232 and its associated
    > > caps are set up
    > > correctly (the data enters pin 13 and exits pin
    > 12).
    > > I think it must
    > > be the code. I'm just using some simple code shown
    > > below.
    > >
    > > ' {$STAMP BS2p}
    > > MyByte VAR Byte
    > > PAUSE 250
    > > DEBUG CLS
    > > Main:
    > > SERIN 0, 16884, 1500, No_GPS_Data, [noparse][[/noparse]MyByte]
    > > DEBUG MyByte
    > > GOTO Main
    > >
    > > No_GPS_Data:
    > > DEBUG "No Data"
    > > GOTO Main
    > >
    > >
    > > I also tried replacing the above SERIN command
    > with:
    > >
    > > SERIN 0, 16884, 1500, No_GPS_Data,
    > [noparse][[/noparse]WAIT("GPRMC,"),
    > > SPSTR 65]
    > >
    > > and the program just hangs waiting.
    > >
    > > I've tried just about everything and after several
    > > days of
    > > frustration I am hoping someone can point me in
    > the
    > > right direction.
    > >
    > > Kind Regards,
    > > Eric
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-02 00:43
    > What Jon was saying is there is an 'Invert' option
    > in the baud-rate selector ($4000). With a MAX232,
    > you need to select 'Invert'. With a 22Kohm resistor,
    > you don't select 'Invert'. Or, vice-versa, I've
    > not yet seen a definitive answer to when you need
    > invert and when not.

    The PC serial port sends & expects to receive all serial data inverted.

    With the Stamp connected to the PC serial port through the MAX232 or
    equivalent converter IC, the Stamp needs to send/receive in TRUE mode
    because data is inverted when passing both directions through the MAX232
    converter IC.

    TTL in RS232 out
    Stamp true serial out >
    > max232 >
    > inverted in to PC

    TTL out RS232 in
    Stamp true serial in <
    < max232 <
    < inverted out from PC

    With the 22K series resistor method or "direct" connection between the
    Stamp & PC serial port, you would use inverted mode due to the PC serial
    port sending & expecting to receive all serial data inverted.

    TTL out
    Stamp inverted serial out to PC >
    > inverted to PC serial in

    RS232 in
    Stamp inverted in from PC <
    /\/\/\/\
    < inverted from PC to Stamp
    22K

    The 22K resistor limits current & helps protect the Stamp input pin from the
    higher RS232 voltage levels, and, as Jon mentioned, in case you inadvertently
    make the Stamp pin an output with the direct connection.

    Regards,

    -Bruce
    tech@r...
    http://www.rentron.com
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-02 01:05
    I accept all you say as true.
    Have you done labs to prove this to yourself?

    The only connection I've made successfully is
    the:
    SEROUT 16, $4000 + 84, [noparse][[/noparse]"HI",13]

    Where I believe the '$4000' (Invert)is required.
    Mind you, this is where the PC is putting
    out what it puts out, and the BS2 is using
    its own 'max232' equivalent.

    "Inverted" here can be hard to define. The
    RS232 signal definition is +12 to -12, with
    'Mark' and 'Space' states. I'm glad you seem
    so positive, though.

    --- In basicstamps@yahoogroups.com, "Bruce" <tech@r...> wrote:
    > > What Jon was saying is there is an 'Invert' option
    > > in the baud-rate selector ($4000). With a MAX232,
    > > you need to select 'Invert'. With a 22Kohm resistor,
    > > you don't select 'Invert'. Or, vice-versa, I've
    > > not yet seen a definitive answer to when you need
    > > invert and when not.
    >
    > The PC serial port sends & expects to receive all serial data
    inverted.
    >
    > With the Stamp connected to the PC serial port through the MAX232 or
    > equivalent converter IC, the Stamp needs to send/receive in TRUE
    mode
    > because data is inverted when passing both directions through the
    MAX232
    > converter IC.
    >
    > TTL in RS232 out
    > Stamp true serial out >
    > max232 >
    >
    inverted in to PC
    >
    > TTL out RS232 in
    > Stamp true serial in <
    < max232 <
    < inverted out
    from PC
    >
    > With the 22K series resistor method or "direct" connection between
    the
    > Stamp & PC serial port, you would use inverted mode due to the PC
    serial
    > port sending & expecting to receive all serial data inverted.
    >
    > TTL out
    > Stamp inverted serial out to PC >
    > inverted to
    PC serial in
    >
    > RS232 in
    > Stamp inverted in from PC <
    /\/\/\/\
    < inverted
    from PC to Stamp
    > 22K
    >
    > The 22K resistor limits current & helps protect the Stamp input pin
    from the
    > higher RS232 voltage levels, and, as Jon mentioned, in case you
    inadvertently
    > make the Stamp pin an output with the direct connection.
    >
    > Regards,
    >
    > -Bruce
    > tech@r...
    > http://www.rentron.com
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-02 20:04
    On 1 Jun 04 at 17:05, Allan Lane wrote:

    > ...The only connection I've made successfully is the:

    > SEROUT 16, $4000 + 84, [noparse][[/noparse]"HI",13]

    > Where I believe the '$4000' (Invert)is required...

    Actually, this is the one instance where the designated polarity is
    of very little consequence. No matter how much you beg, cajole or
    threaten your Stamp, it will only SEROUT inverted data when you
    specify I/O 16, no matter the contents of baudmode's bit 14. For I/O
    16, only the polarity of FPIN is affected by that bit's value. Try
    it for yourself:

    SEROUT 16, 84, [noparse][[/noparse]"HI",13]

    Regards,

    Steve
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-02 20:33
    > I accept all you say as true.
    > Have you done labs to prove this to yourself?

    Yes. You can easily test idle serial logic states with your Stamp
    something like this;

    Loop:
    HIGH 1 ' Take pin 1 high
    PAUSE 2000 ' Wait a bit
    SEROUT 1, 16780, [noparse][[/noparse]"Hello"] ' Send the greeting.

    ' Place a logic probe on pin 1 and see what logic state
    ' pin 1 stays in when program flow gets to the Here routine

    Here: ' Blink an LED on pin 15
    HIGH 15
    PAUSE 500
    LOW 15
    PAUSE 500
    GOTO Here

    Now change the baud mode from inverted (16780) to true (396), and set
    pin 1 low before entering the serout line something like this;

    Loop:
    LOW 1 ' Take pin 1 low
    PAUSE 2000 ' Wait a bit
    SEROUT 1, 16780, [noparse][[/noparse]"Hello"] ' Send the greeting.

    ' Place a logic probe on pin 1 and see what logic state
    ' pin 1 stays in when program flow gets to the Here routine

    Here:
    HIGH 15
    PAUSE 500
    LOW 15
    PAUSE 500
    GOTO Here

    This shows you how the Stamp assumes you'll be using the pin for more
    serial output, and leaves it at the appropriate idle logic after the SEROUT
    commands using both true or inverted modes.

    If you refer the a MAX232 internal block diagram you'll see how this logic
    works. They normally include pull-up & pull-down resistors to hold both
    sides in the idle states should the device be disconnected on not powered
    up. http://www.rentron.com/Files/bMAX232.gif

    > The only connection I've made successfully is
    > the: SEROUT 16, $4000 + 84, [noparse][[/noparse]"HI",13]

    Using the Stamp modules "built-in" serial programming pin is different
    since the Stamp module includes additional "onboard" circuitry for the
    RS232 programming/debug connection. You can verify/view this in the
    Stamp module schematic.

    The original thread/problem used > > SERIN 0, 16884, 1500, etc, etc,
    and was not using the Stamps built-in RS232 circuit.

    > Where I believe the '$4000' (Invert)is required.
    > Mind you, this is where the PC is putting
    > out what it puts out, and the BS2 is using
    > its own 'max232' equivalent.
    >
    > "Inverted" here can be hard to define. The
    > RS232 signal definition is +12 to -12, with
    > 'Mark' and 'Space' states. I'm glad you seem
    > so positive, though.

    Using the Stamps built-in RS232 circuit on pin 16, you can't change modes
    between inverted or true. Only baud rates.

    Regards,

    -Bruce

    tech@r...
    Reynolds Electronics
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-03 00:55
    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > If you have an RS-232 level signal then you can feed it to the
    BASIC
    > Stamp through a 22K resistor (protects the pin if it accidentally
    gets
    > made an output). I've done this with serial devices on several
    > occasions. Honestly, I don't know why you're having problems.
    I've
    > used the Garmin eTrex in more than a few projects and have never
    had any
    > difficulty with it. I know you're using a different model, but you
    > should still have success.

    Jon, do you (or anyone) know if the Garmin Geko 101 can be
    interfaced to the BS2? All this talk about interfacing GPS to BS2,
    and I see Radio Shack has the Garmin Geko 101 for sale for around
    $84.00.

    Chris Savage
    Knight Designs
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-03 02:36
    Yes, I have also connected a Geko unit to the BS2p. No problem.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Chris Savage [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=nVqPmumqOgqP5C4r1ALQ9oMZfrxh-SFMhu9DJN2TtcH-tsqseVO8sE5Si4auq6gYKopVuqFGPCqs7u43TOSx90yN]knight_designs@y...[/url
    Sent: Wednesday, June 02, 2004 6:55 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: At wits end reading NMEA GPS sentence


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > If you have an RS-232 level signal then you can feed it to the
    BASIC
    > Stamp through a 22K resistor (protects the pin if it accidentally
    gets
    > made an output). I've done this with serial devices on several
    > occasions. Honestly, I don't know why you're having problems.
    I've
    > used the Garmin eTrex in more than a few projects and have never
    had any
    > difficulty with it. I know you're using a different model, but you
    > should still have success.

    Jon, do you (or anyone) know if the Garmin Geko 101 can be
    interfaced to the BS2? All this talk about interfacing GPS to BS2,
    and I see Radio Shack has the Garmin Geko 101 for sale for around
    $84.00.

    Chris Savage
    Knight Designs




    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







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-04 01:01
    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Yes, I have also connected a Geko unit to the BS2p. No problem.
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office

    Thanks Jon! Perhaps someone will get me one for Father's Day? ;-)

    Chris Savage
    Knight Designs
Sign In or Register to comment.