Shop OBEX P1 Docs P2 Docs Learn Events
Question About eTrex GPS and BS2 — Parallax Forums

Question About eTrex GPS and BS2

SteveMiller10SteveMiller10 Posts: 7
edited 2006-05-02 13:50 in BASIC Stamp
I just bought an eTrex GPS unit and a connecting serial cable. What is the best way to connect my BS2 to this unit? Specifically, what pins from the GPS's serial cable go to power, ground and the BS2? I read an article in NV about a project involving a car speedo and the eTrex -- so I know it can be done. But I am confused about the physical connections. Thanks!

Comments

  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-25 17:02
    Check out this excellent Nuts 'n' Volts column - GPS with eTrek. Perfect!

    www.parallax.com/dl/docs/cols/nv/vol3/col/nv83.pdf
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-04-25 17:31
    Yes -- I've read that article. But I have a BS2, not a BS2p. Is there a program that I can use that will read data into the BS2 from the eTrex? And I still don't understand which pins need to be connected. Any ideas?
  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-25 17:41
    Well I don't have one myself - I pointed that article out as it seems to have a section on how to connect to a BS2 (I note a BS2p is mentioned later in the article so it must be possible)

    I haven't read through the whole article again, but that diagram and the relevant text seems to show the eTrex cable/connector simply has a ground (black) and a data (white) conenction. The white lead is data which seems to simply goto an input pin on the BS. Looking at the top of the program list halfway down the article, the code declares one pin for the data input, and reads data straight away in main: using SERIN

    Do you not just connect the white lead to a pin on the BS2p, and ground the other lead? That seems to be all that's required.

    What have you tried so far?
  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-25 17:45
    Sorry I mis-read your post and thought you HAD a BS2p. The article states they use a undocumented SPSTR serial modifer on the BS2p as you know.

    Perhaps there is a workaround to this, Jon or Chris should be able to help if so...
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-04-25 18:11
    Jon provided a BS2 solution for the Garmin eTrex here: http://forums.parallax.com/showthread.php?p=578244
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-04-25 18:27
    Good. That program looks like it should work. Still does anyone know which pins on the serial coming out of the eTrex correspond to ground and data out? Thanks.
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-04-25 18:30
    SteveMiller10 said...
    Good. That program looks like it should work. Still does anyone know which pins on the serial coming out of the eTrex correspond to ground and data out? Thanks.

    Standard DB9 RS232 wiring

    If you want ALL the gorey details, try this: www.garmin.com/specs/pcwiring.pdf

    Post Edited (pwssr) : 4/25/2006 6:42:38 PM GMT
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-04-28 06:18
    Ahh it's not working. I am using John's program http://forums.parallax.com/forums/attach.aspx?a=6444 on my bs2. I have the eTrex connected by serial to the stamp with >>> DB2 (Rx) going to P0 on the bs2 and DB5 going to ground. What am I missing? Shouldn't I be seeing GPS data in the debug window?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-28 06:46
    You need to use pin 3 of the DB-9.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-05-02 02:09
    pin3 on the db9 goes to p0 on the stamp
    pin5 on the db9 goes to ground!

    help! it's not working
  • ForrestForrest Posts: 1,341
    edited 2006-05-02 02:42
    Did you set your Garmin GPS to 2400 baud Text Output?
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-05-02 02:57
    no i didn't... how do i do that...
  • SteveMiller10SteveMiller10 Posts: 7
    edited 2006-05-02 05:42
    okay i figured that out... but now that i have data coming in i don't know how to process it.

    i am trying to do something like this:

    if alt > 1000 then: LIGHTON
    if alt < 300 then LIGHTOFF

    but it doesn't treat alt like a number?
  • SSteveSSteve Posts: 808
    edited 2006-05-02 06:41
    Looking over the code it seems like alt should be a number. Try inserting a "DEBUG DEC alt, CR" statement right before your IF/THEN statements. What value do you see in the debug window?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-05-02 06:59
    Steve Miller -

    I don't see what program you're using, but I suspect I may see the problem. The variable "ALT" MUST be defined as a WORD, if its to have values greater then 255 in it. A byte can only contain values from 0 ==> 255.

    If "ALT" is an input variable (from a SERIN) then it must be read in as alt.highbyte and alt.lowbyte, as asynchronous serial data is transmitted on a BYTE basis, and it take 2 BYTES to make a WORD.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • SSteveSSteve Posts: 808
    edited 2006-05-02 13:50
    I believe he's using the code Jon wrote that was referred to earlier: http://forums.parallax.com/showthread.php?p=578244. It reads alt from the string of ASCII sent by the eTrex.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
Sign In or Register to comment.