Reading inverted GPS data
sylvie369
Posts: 1,622
One of my ongoing projects is to read GPS data from a small receiver and send them directly out an XBee module to a Prop-based receiver. I've been able to get the XBee to get data from the GPS (currently a Byonics GPS2, though I expect to use something smaller once I get going seriously on the project), but I get gibberish on the screen. I've confirmed (by turning on/off the GPS) that what I'm getting is data from the GPS, but I haven't been able to read them intelligibly.
Today I hooked the thing up without XBees directly to a BS2sx on a carrier board, and managed to get the data to display properly. I learned that the data from the GPS are inverted, and I strongly suspect that's why I'm not able to read them on my terminal program when I try sending them straight through the XBee. As far as I can see, the XBee cannot be set to interpret serial data coming in as inverted (though you can change all the other stuff - the baudrate, bits, parity, stopbits). I'd hoped that I could just receive the data and invert them·in my terminal program, but that just gives me a different kind of gibberish.
My question:
I suspect that what I need to do is put an inverter circuit (well, chip - a 7404?) between the GPS data in line and the transmitting XBee. Does that sound right?
=====================
While I'm asking, maybe someone familiar with XBees can confirm my other assumption. They default to 9600 8N1 communications*, and since the GPS sends data out at 4800, I had to change the serial settings on the XBee connected to the GPS to 4800 8N1. That seems to work just fine. I assume that I do NOT have to change the default (9600) setting on the XBee that will receive the data, though - that it will simply receive the data at whatever speed, and can use 9600 8N1 to communicate with the terminal program on the receiver side. Does that sound right?
* That is, communications with the host, be it a terminal program or a microprocessor. I don't think that the baudrate has anything to do directly with how one XBee communicates with another, but of course that's what I'm asking about. Can one that's set to talk to a terminal program at 9600 baud receive data from another one that's set to talk to a GPS at 4800 baud?
Post Edited (sylvie369) : 1/4/2010 5:28:34 PM GMT
Today I hooked the thing up without XBees directly to a BS2sx on a carrier board, and managed to get the data to display properly. I learned that the data from the GPS are inverted, and I strongly suspect that's why I'm not able to read them on my terminal program when I try sending them straight through the XBee. As far as I can see, the XBee cannot be set to interpret serial data coming in as inverted (though you can change all the other stuff - the baudrate, bits, parity, stopbits). I'd hoped that I could just receive the data and invert them·in my terminal program, but that just gives me a different kind of gibberish.
My question:
I suspect that what I need to do is put an inverter circuit (well, chip - a 7404?) between the GPS data in line and the transmitting XBee. Does that sound right?
=====================
While I'm asking, maybe someone familiar with XBees can confirm my other assumption. They default to 9600 8N1 communications*, and since the GPS sends data out at 4800, I had to change the serial settings on the XBee connected to the GPS to 4800 8N1. That seems to work just fine. I assume that I do NOT have to change the default (9600) setting on the XBee that will receive the data, though - that it will simply receive the data at whatever speed, and can use 9600 8N1 to communicate with the terminal program on the receiver side. Does that sound right?
* That is, communications with the host, be it a terminal program or a microprocessor. I don't think that the baudrate has anything to do directly with how one XBee communicates with another, but of course that's what I'm asking about. Can one that's set to talk to a terminal program at 9600 baud receive data from another one that's set to talk to a GPS at 4800 baud?
Post Edited (sylvie369) : 1/4/2010 5:28:34 PM GMT
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
I did find a couple of ancient 7404s here, and after making sure that one still worked, hooked it up. I did get the data properly un-inverted (they showed up properly in a DEBUG window when I read them with my BS2sx using the non-inverted SERIN code), at least briefly. However, somewhere along the way it stopped working, quite possibly because these 7404s have been sitting around here since roughly the time that dirt was invented (I think they're the old vacuum-tube type of IC, and might even have gears in 'em).
I see that the data from the Parallax GPS are not inverted - apparently inverted data is not a GPS standard, I guess. I'm expecting to put together a board for this device, and I guess I'm going to have to decide for sure which GPS I'll be using.
Thanks.
If you want to put off deciding on a GPS (or want the flexibility), you could always include a jumper on the board that switches between uninverted and inverted data sources.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm
Hopefully I'll have time to mess with this tomorrow.
(10 minutes later: ) Hot dang! It works! It's pumping out NMEA strings from the XBee receiver to a terminal program even as I write. Very nice. Thanks.
Oh, and that answers my second question. I was right in my assumption: the XBee on the receiving end does not need to have its serial communications setting at the same speed as the one talking to the GPS on the transmitting end. Those serial baud rates have nothing to do with one XBee talking with another. One is getting data from GPS at 4800 baud while the other is sending data to the terminal program at 9600 baud. No problem.
Post Edited (sylvie369) : 1/5/2010 2:19:30 PM GMT