SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By permagne
#82318
Hi.

I'm relative new to this kind of work, but for a project I'd like to connect my Garmin GPSMAP76S to my serial port on my computer via two XBee modems.

I'd like to send the NMEA 0183 string from the GPS tor the computer. When I connect my GPS i can read i plain text using either X-CTU or Hyperterminal the information sent by the GPS. When connecting through the XBee modems I can se that information is sent by the GPS, but the information witch shows in either Hyperterminal or X-CTU is not understandable at all.

}m•å›Ÿ™›—›§S§“™Ÿ
By waltr
#82328
My first guess is a Baud rate mismatch or the serial set-up mismatch.
The XBees uses 8 bit, no parity and 1 stop bit by default. Check that this matches on both ends as well as the baud rate.
This could be either between the GPS and the transmitting XBee or between the receiving XBee and the PC.

Can you read the XBee modem configurations with X_CTU? This is where you check the XBee settings and make changes if needed.
By Johan Adler
#82356
The signals from the GPS, are they RS232, e.g. from a 9 pin D-sub connector? You may need to invert the signals to get the correct signal polarity for the TTL/UART communication with the Xbee module.

When connecting the GPS to the computer, exactly how is it connected? Are you using a serial port on the computer, or maybe a USB to serial adapter?

Try running the GPS data output (GPS Tx to Xbee Din) through a 74HC04. It could do the trick.

/Johan Adler
By stevech
#82386
is GPS serial data logic level or RS232?
If RS232, you know about voltage levels needed for the XBee, right?
If logic level, it may be inverted.

Of course, you know that most NMEA serial defaults to 4800baud
By permagne
#82393
The GPS signal is sent via an 9-pin D-sub connector, which I've connected ground from Gps -cable to GND on Xbee serial board, and GPS TX signal to Din on the Xbee serial board. I'm not sure if this qualifies for logic level or RS232, but my impression was to the RS232.

If RS232, how does the voltage level compare to what the Xbee needs?

Baud 4800, databits 8, parity none, stop bit 1 on both XbeePro's.
I configure both from X-CTU. I'm pretty sure the baud rate settings are ok, so I think it's a trick with the serial setup. Something is passing through, but i dont know what.

When connecting directly to the computer I use the 9-pin D-sub serial port.

Here is a screen shot. GPS to computer on the left. Via Xbee and X-CTU on the right...
Image

Thanks
By waltr
#82413
permagne wrote: When connecting directly to the computer I use the 9-pin D-sub serial port.
If that 9-pin 'D' from the GPS works when connected the your PC it will not work if connected directly to the XBee.
The serial signals into a PC COM port are negative logic and are +/-12V to be fully RS232 compliant. However, most COM ports on PC these days work perfectly fine with 0 to 5V signals but they are still negative logic.

On asynchronous serial's logic level the start bit is high, a 1 is high and a 0 is low with the stop bit being low (normally 0V for a low and 5V for a high). On true RS232 the logic is inverted and driven to -12V for a logic high and +12V for a logic low (Start bit is -12V, stop is +12V). Or the PC will accept 0V for a high and +5V for a low (Start is 0V and stop is +5V).

As stevech said about inverted logic. I get back to this in a minute.

The PC UART will decode the inverted bit stream (just like a wrong baud rate) as garbage. Also the XBee's inputs are NOT 5V tolerant (spec is 3.6V MAX). But the SparkFun XBee regulated board has saved the XBee by blocking the +5V with a diode (just went through this with someone on the Digi Int forum and my own interfacing of an XBee with a PIC) so that the XBee's Din never sees a +voltage. For the Din to go high the internal pull-up, AT command 'PR' bit 7, needs to be enabled or an external pull-up installed. Check the XBee Doc and the SparkFun XBee regulated board schematic.

The XBee Explorer Serial should have worked as to contains an RS232 receiver that inverts the serial logic. Did you get garbage or nothing when you tried this on the GPS end?

Try to simplify and not use the GPS. Since you have two XBees and two XBee Explorer Serial boards connect both to your PC on two COM ports. You should be able to open two terminal programs (or a terminal program and X-CTU's terminal tab ) and send data from one to the other.
Once you have this working then try adding in the GPS.

I looked up the GPS you have and check the user's manual but as with too much of the commercial stuff that is sold today the information was extremely lacking. If you have access to an O-scope then the signal voltages, logic and timing can be measured. Then we would know exactly what to do.
By waltr
#82693
Good catch Johan.
Inverted logic will get you.
Hope everyone can get their Garmins working through the XBee now.
User avatar
By mitchind
#82700
waltr wrote: Good catch Johan.
Inverted logic will get you.
Looks like some praise gets shared with Steve too. :D
stevech wrote:is GPS serial data logic level or RS232?
If RS232, you know about voltage levels needed for the XBee, right?
If logic level, it may be inverted.
By waltr
#82710
Yep, Steve also.
Sorry Steve.
By stevech
#82715
lost in the word-storm.
By permagne
#82723
Thanks guys!

This will help me on my way. I'll post more when I'm lost again and have time to test some more... As a mechanical engineer, bauds, stop bits, en pull high/low is a bit difficult to "see". So you might need som patiance with me.

thx

Per Magne
By sylvie369
#82730
Since we're praising the guys who figured this out, let me add my thanks. I was facing the same question, and following closely here.
By Johan Adler
#82779
As I wrote on my blog I chose a Globalsat BR-355 for my Arduino project in order to have an external weatherproof unit that can be placed for optimal reception. I tried for a very long time to make it work, and it was not until I bought a Saleae Logic analyzer that I was able to figure out what the problem was.

The BR-355 was also cheaper than the smaller units usually sold for use with microcontroller projects. When I opened it I found what I guess might be an EM-406a module inside. If I am right this receiver might actually be a cheaper source for the EM-406a than buying the module itself. It even has the same kind of connector as the EM-406a and can easily be disconnected from the rest of the receiver.
User avatar
By mitchind
#82787
Nice blog Johan. Appreciate you taking the time to write about your debugging and testing efforts.

Also - interesting deduction on the internal module. Might be worth a followup call to USGlobalSat to confirm.