Shop OBEX P1 Docs P2 Docs Learn Events
bs2 and ps/2 GPS-unit — Parallax Forums

bs2 and ps/2 GPS-unit

Jon LoldrupJon Loldrup Posts: 14
edited 2007-05-24 12:32 in BASIC Stamp
Hi

I'm trying to interface my ps/2 GPS-unit to my bs2. The GPS is a dumb thing that justs spits its NMEA-information out its TX-line once it has power. I have splitted the ps/2-stick so I feed it power directly. My question is - can I just connect the TX-line from the GPS to the line-receiver (pin 2) of the BS2 or will it fry things? (I'm thinking: if the signal voltage is 12 volts, it might be bad?). The GPS power supply is only 5 volt though

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
/jon

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-21 19:49
    Jon,

    On our GPS the data is only sent out when the /RAW line is driven low. Otherwise it sends its data to the SX on the bottom for parsing. If you want to send the data directly to the BS2, then just drive the /RAW line low. What is it you’re trying to do?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-21 20:44
    Wow, quick reply [noparse]:)[/noparse]

    I'm trying to use SERIN to take the NMEA-commands so I can parse them and thereby extract my position.
    The documentation for my GPS says that it only uses 4 of the 6 pins in the ps/2-connector. Theese are:

    pin 2: Power
    pin 1: Ground
    pin 4: RX
    pin 5: TX

    no /RAW-thing..

    What is this /RAW-line? Never heard of it.
    What do you mean with "on the bottom" in "Otherwise it sends its data to the SX on the bottom for parsing"?

    I just tested using Windows Hyperterminal with just three lines: power, ground and TX. It works! (ie. it spits out NMEA-info). So I guess I don't need to drive anything high/low to make it work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-22 04:05
    Jon,

    I apologize…I thought you were talking about the Parallax GPS unit which does have a /RAW line. You didn’t really specify so I assumed it was our product. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-22 07:03
    Ok, but can the pin 2 of the BS2 take 12 volt input?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
  • WynandWynand Posts: 39
    edited 2007-05-22 11:37
    No, inputs on the BS2 must be limited to 5v (TTL level). If it is a PS/2 gps, then it will run at 5v and transmit at TTL levels (0v logic low, 5v, logiv high), just like the BS2, so·the BS2·would·have no poblem with·reading the data comming from the gps. Just make sure you use the correct baud rate, then you can do it with the SERIN command. Then all you have to do it to parse the NMEA string for the information you need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why didn't I think of THAT!!!!

    Post Edited (Wynand) : 5/22/2007 12:15:12 PM GMT
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-22 18:02
    It works! [noparse]:D[/noparse]
    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-23 10:03
    I have two more questions:

    If the ps/2-gps delivers 5 volt on its TX-line, and the BS2 accepts 5 volts on its input-pins, why then do I need to put a 22 k ohm resistor in between? (the BS2 manual says that I should do so, and indeed I do so). This resistor will obviously reduce the voltage to something lower than 5 volt. I don't get why it can't just connect directly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-23 10:22
    and the second:

    How come the BS2 can communicate with a PC when placed on a board like this: http://www.zerko.ch/images/02b8e6987008e560c.jpg , when there is no MAX232-unit present on that board? Normal rs232 as found on the PC's serial ports uses +5 to +12 volt for logic 1 and -5 to -12 for logic zero - highly incompatible with the bs2's TTL-requirements (0v logic low, 5v, logiv high).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-23 14:00
    Jon,

    The answer to your second question is that the BASIC Stamp 2 has on-board level converters for the programming port. You can see these components in the schematic listed on the product page. The transistors reduce the level the BASIC Stamp sees at its programming pins. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-05-23 14:20
    The operation of the in-line 22 Kohm resistor is interesting.

    The input resistance of the PIC chip (that the BS2 uses) is pretty high -- 10 Megohm, I believe. So putting an additional 22 Kohm resistor in there does not diminish a 5 volt signal very much.

    However, if you DO put a +- 12 volt signal on the 'far end' of the 22 Kohm resistor, something interesting happens. It turns out the input pin on the BS2 has "protection diodes", which will try to 'clip' an incoming signal to the point where it won't damage the BS2 input transistor. But, these "protection diodes" can't handle a whole lot of current. The 22 Kohm resistor drops the resulting current to the point where it won't burn-out the protection diodes.

    The result is, when you feed +12 volts to the 'far-end' of the 22 Kohm resistor, the high-side protection diode 'clips' that signal to 5 volts inside the BS2 -- and you get a 'high'. When you feed -12 volts, the low-side protection diode 'clips' that signal to 0 volts inside the BS2 -- and you get a 'low'. So everything works as you need it to, nothing is damaged, and all for adding a simple 22 Kohm resistor. Pretty neat, eh?
  • Jon LoldrupJon Loldrup Posts: 14
    edited 2007-05-24 12:32
    Thats pretty neat [noparse]:)[/noparse]
    Does that mean that I can always skip using max232 chips when doing SERIN from normal rs232-devices? (SEROUT will obviously need conversion to rs232 voltage levels as the output from the BS2 will be at TTL-levels)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /jon
Sign In or Register to comment.