Mediatek MT3329 with xbee

I would like to connect a mediatek MT3329 GPS module https://store.diydrones.com/ProductDeta … =MT3329-02 with a xbee 2,4Ghz and transmit the nmea string to a pc.

Mediatek was reprogrammed to send nmea at 9600bps. Also Xbee’s were set at 9600bps.

I connected the gps TX to Din of the xbee (through regulator board) and powered the modules with 5V.

At the receiving end I checked the data with hyperterminal but the incoming data was unreadable.

When connecting gps through FTDI cable to pc everything looks ok.

What am I doing wrong?

Help would be very much appreciated.

Which XBee modules?

Is the XBee that is connected to the PC in AT or API commend mode?

Read the XBee manual to learn the difference.

When connecting gps through FTDI cable to pc everything looks ok.

Very good first test. You now know the problem is in the RF link and XBee.

At the receiving end I checked the data with hyperterminal but the incoming data was unreadable

This is commonly an indication of a Baud rate mismatch. Does the X-CTU utility connect properly to the XBee?

I’m using the xbee pro 2,4Ghz with whip antenna.

I don’t really know in what mode they are programmed.

One thing I do know is that the xbees worked fine for telemetry of mavlink protocol, used with arducopter.

So one was connected to the quads APM and the other on the PC for use in a ground control station.

The xbee’s connect without a problem to X-CTU and all setting on both xbee’s are the same. Bps is the same as GPS.

Could this have something to do with the 5V power supply on the GPS? Won’t the signal levels coming from the gps be to high for the xbee?

XBee’s are 3.3V devices so the serial data levels should be for 3.3V logic.

Re-check the voltage levels out of the GPS. Use an O’scope if you can to ensure high and low levels.

If the GPS is outputting 5V logic levels then a simple resistor divider works to reduce the level to 3.3V.

Also with the O’scope, check the polarity of the serial data from the GPS, Idle = high, Start bit = low, data is non-inverted.

Waltr, thx for the info.

I don’t have aan O’scope at hand at the moment but will look for one asap.

Meanwhile this is the datasheet of the gps

https://docs.google.com/file/d/0B_dHj7E … l=en&pli=1

It mentiones that the high and low levels of the output is 3.3V.

When connecting the gps to the computer a used a FTDI cable.

Photos of the setup and the GPS board and a sample terminal output would make this a trivial exercise to troubleshoot.

Without photos/board layouts to view and maybe eliminate RF noise and other transient sorts of things, I would guess you have a mismatch between the PC terminal and xbee speeds.

I’ll make photos during the weekend.

thx

OK, I retested everything and checkes that all modules were at 9600bps. So Xbee’s GPS output and Hyperterminal.

On hyperterminal this is the data that comes in. Its update about every second and sometimes overwrites itself.

http://i699.photobucket.com/albums/vv35 … nde/HT.jpg

This is my setup on the PC side

http://i699.photobucket.com/albums/vv35 … e/pc-1.jpg

This is the setup on the GPS side

http://i699.photobucket.com/albums/vv35 … de/gps.jpg

Both sides are power supplied by 5V coming from a USB.

On the gps side the GPS TX is connected wit Din on the explorerboard.

The GPS itself is powered by 3,3V coming from the 3,3V of the explorerboard.

Also gnd between GPS and explorerboard is connected.

The wires between the XBee and GPS don’t look too long for 9600 Baud so that shouldn’t be the problem.

Still looks like a Baud rate mismatch. In Hyperterm, just try every Baud rate to see if its just a simple Baud rate mismatch.

This will check that the XBee to PC Baud rate is correct.

Still need to check the GPS to XBee Baud rate. An O’scope would be best for that.

I just tested again with an older serial gps. Its programmed to send at 4800bps and works great directly connected to the pc.

So I changed both xbee’s to the same speed.

Same problem in hyperterminal. All unreadable.

There must be something wrong with the signal.

Any more suggestions?

That really does appear to be a comms mismatch issue. You can see repeating patterns, but the chars are garbage. You also mention it updates about every second, which means the GPS is sending data and you are receiving it at the default 1Hz rate. I notice the HT has 8N1 on the bottom display. Maybe this has something to do with CRC/error correction on HT that’s not on the source signal from the xbee usb adapter?

Also, you should twist vcc/ground pairs together whenever running them any distance. The gps leads are probably too short to cause problems, but it’s a good habit to get into. Twist them together somewhat tightly and keep the pair away from your signal line.

One last test, switch your xbees. If the HT chars/patterns change, your xbees are talking at different speeds. If there’s no change, they are communicating properly but the problem exists on the GPS or computer side.

Switched the xbee’s and data is the same. So thats good.

Xbee’s are just a wireless serial connection so it can’t be that difficult to find the problem, but it seems i’m stuck. :?

I just found this in a rc forum. But can’t quite figure out the schematics.

http://www.rcgroups.com/forums/showthread.php?t=993165

http://static.rcgroups.net/forums/attac … sdiag2.jpg

That schematic shows the same connection you have except it has 2 caps (10pF and .1pF I think) from vcc to ground at the xbee connection and what appears to be a voltage divider using resistors (only one showing). The caps wouldn’t be a bad idea to filter the RF, but the xbee’s caps should be good enough and your adapter shield probably already has them.

I keep going back to this being a comms mismatch. Try reprogramming xbees and gps to 9600. If the garbage chars are showing up at 1 sec intervals and the GPS communicates with HT with real data, the xbee to gps link must be mismatched as waltr mentioned earlier.

Ok, after some more tinckering and putting the gps out through a invertor it still didn’t work.

Then I wanted to reset everything but first I wanted to check the nmea output again of the gps with HT directly connected to the pc. All the data was gash …

I decided to reflash the mediatek again with the diydrones firmware. I also read somewhere that the specific protocol was called upon by the arducopter software and that the gps was default in NMEA.

Also the default bps was 38400.

I then rechecked with HT and the NMEA strings were coming in.

Reprogrammed the xbee’s to 38400 an behold … It works!!!

Finally.

Nevertheless thanks for the help.It started me thinking a lot.

Ok, Success.

Without a scope this does become difficult to troubleshoot.

Hi! May i knw the firmware u used to flash ur MT3329? N hw’d u go abt flashin it?

I followed this

http://code.google.com/p/ardupilot/wiki/MediaTek

Curious about the application… because the RF range of the XBee Pros without high gain antennas: is not a great deal more than the error in GPS location estimates!

I got arround testing the xbee pro’s 900 with standaard wire antenna’s in a build up area with the receiving station indoors and I would get about a 200m range. So If I would use high gain antenne at a height it would be greatly improved.

Ah, 900MHz, not 2.4GHz

Re the baud rate: the NMEA standard says the factory default is to be 4800. Someone changed it.