Shop OBEX P1 Docs P2 Docs Learn Events
GPS Interfacing — Parallax Forums

GPS Interfacing

ArchiverArchiver Posts: 46,084
edited 2001-02-06 07:58 in General Discussion
Mike-

It's reasonably safe to assume your GPS is sending its serial data
LSB first. That's a pretty universal standard and it's what your
Stamp (and virtually every other async serial device) expects to see.

A high start bit and low stop bit mean it's transmitting in what your
Stamp understands as "non-inverted" mode. BS2SX/4800/non-inverted
translates to Baudmode 500 if I read the chart right.

Try:

SERIN 1,500,[noparse][[/noparse]name]


Steve

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 04:35
    I have a BS2 SX chip, and I'm trying to interface
    it with a Garmin Emap GPS device for a college design
    project. I am having difficulty getting the stamp to
    correctly interpret the incoming serial data from the
    GPS.
    I'm using the Simple text output, with 4800 baud.
    I'm trying to use the Serin command, but so far the
    Stamp isn't correctly interpreting the data. I have
    put it on the oscilloscope, and it appears that the
    GPS is sending out, for every ascii character: One
    Start bit, which is high, eight data bits, LSB first,
    and then a low stop bit. I have found that i can get
    the correct ascii data by taking the data bits of
    character, reversing their order, and then inverting
    them. Here is the command I have used to accept the
    data:

    serin 1, 16468, [noparse][[/noparse]name]

    I think i can take care of the inversion by
    changing the 16468, I'm not too worried about that
    part, but i don't have any idea how to get the bits in
    the correct order. (MSB first) I've looked in the
    manuals but I can't seem to find any serin modifiers
    that toggle that. Furthermore, I don't think I can
    use the shiftout function, because I don't have anyway
    to clock the data out of the GPS. If anyone has any
    ideas, I would be EXTREMELY grateful! Thank you!

    Mike Irvine

    P.S. I believe that the data coming out of the GPS is
    MSB first. My memory could be wrong, and it could be
    that the data out of the GPS is LSB and the chip is
    reading MSB. Either way, it's backwards. Thanks
    again!
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-06 07:58
    To reverse the order of 8 bits use the REV operator.
    value = value REV 8
    Regards
    ECO
    Original Message
    From: <mjirvine@m...>
    To: <basicstamps@yahoogroups.com>
    Sent: lundi 5 f
Sign In or Register to comment.