Serial communication issue (FTDI : GPS 406A : ArduPilot Mega

I am having an issue getting data from my EM-406A SiRF III GPS Receiver. I am using the ArduPilot Mega as a make-shift breakout board for the EM406 connector.

This is more a technical question about serial communication, but I figured this was the best place to post it.

I have come up with short and long term solutions to my problem. (long: I bought the EM-406 break out board. Short: see below) I am really looking for “why” things are not working the way I thought they would. In addition, why did my short-term solution work?

Hardware (all new. I just unboxed last Monday):

GPS: EM-406A SiRF III Receiver http://www.sparkfun.com/products/465

FTDI Basic Breakout - 3.3V: http://www.sparkfun.com/products/9873

ArduPilot Mega (never programmed, only soldered in connector pins): http://www.sparkfun.com/products/9710

The ArduPilot Mega has a em406 connector and pins that breakout the GND,+5V,RX1,TX1, pins.

I plugged the GPS into the em406 connector and used jumper wires to hook the 4 pins from the mega board to the FTDI board. I realized this would power up the ArduPilot, but I “Assumed” that as long as I was only listening on the RX line of the FTDI that I could have all three serial devices hooked up.

The green RX light on the FTDI board lights up, but I am not receiving on the terminal screen. I then launched into several trouble shooting methods:

*Connected only one wire from the TX to RX of the FTDI as a loop back. (terminal is working correctly). Anything I type shows up back on the screen. I am assuming that everything from the computer to the FTDI board is working correctly.

*I hooked the FTDI back to the 4 pins (GND,+5V,RX1,TX1 labeled GPS port) on the ArduPilot Mega board and swapped the TX and RX (no success ). The RX light is lit in both cases. The light pulses at about 1hz. (the speed I expect the GPS data to be sent at).

*Maybe there is default programming on the ArduPilot mega giving me grief? I compiled the blink example and downloaded it to the board. I assume this will reset all pins to inactive and idle everything except the pin it is trying to blink. I did not test this program. As far as I know there is no LED hooked to a pin like a real Ardunio Mega. I am focused on the GPS for now. I will start working with the micro-controller later. In any case there was no difference in how the serial communication reacted.

*My break trough came when the FTDI was hooked to the mega board as I thought it should be. I was still struggling to figure out why I got the green light flashing at 1 hz and no data reaching the terminal screen. At some point I decided to jumper a crossed the TX and RX pins. I got a garbled mess on the terminal screen. I know this was due to the fact that I was holding the jumper by hand and causing instantaneous connects and disconnects. I rewired something on a bread board to tie the TX and RX lines together. I got the GPS data I was expecting. (the RX LED seemed brighter)

I should have my breakout later this week, but I am still curious why this did not work.

Why connecting the TX and RX lines together work? I did not get data from the TX or RX lines by them selves, but together it comes through fine.

3 Serial devices (FTDI, Microcontroller, GPS ) connected like this should be fine? I know I need to watch the communications, but if only one is “talking” then I should be able to have multiple listeners. Right?

Unless some one has a better idea: My plan is to wire up a second 5V power source to the ArduPilot board first and then only connect the GND, TX and RX to the FTDI board. This is just to play around until my breakout board comes in the mail.

I have worked on this a little more.

Some-more odd behavior and a few more answers.

I assumed that the FTDI gave 5 volts despite all the evidence to the contrary (the product label, silk screening on the board etc…). Useing a 5V power supply did not help the situation, it only added to my confusion.

With a 5V source:

connecting the TX and RX lines both to the RX of the FTDI did not work

with the ArduPilot Mega TX1 connected to FTDI TXO and RX1 to RXI and when hard resetting (pull the power, then re-insert) i get the following in the terminal

$PSRFTXT,Version:GSW3.2.4_3.1.00.12-SDK003P1.00a
$PSRFTXT,Version2:F-GPS-03-0701301
$PSRFTXT,WAAS Enable
$PSRFTXT,TOW:  77605
$PSRFTXT,WK:   1628
$PSRFTXT,POS:  1156669 -4666979 4176993
$PSRFTXT,CLK:  96534
$PSRFTXT,CHNL: 12
$PSRFTXT,Baud rate: 4800

But after that prints there is nothing. The RX light also gets dimmer, or the blinks are shorter.

I then decided to hold in the reset button. (just momentarily pressing the button as done nothing so far.)

Eureka! Everything works as i think it should with the reset button held in! Also powering it with 3.3 or 5V works with the Reset button held in.

The light is also brighter or longer.

So i have a second work around that works. I still don’t know why either one works.

I think it has to due with the state of the microprocessor pins. My next step will be to write a short sketch to read the data from TX1/RX1 and do nothing with it. I hope by setting this to be a serial port the pins will act more like i think they should.

my questions are:

why when powered by 3.3V can i connect the TX1 and RX1 to RX on the FTDI and get data?

Why do i get momentary data after a hard reset?

What is different when i hold in the rest button that allows me to get data?

In case some one ever runs a crossed this having the same issue…

I put the multiple serial sketch from the Arduino examples on the ArduPilot Mega and everything seems to work fine now. (and the way i thought 3 serial devices tied together would)

I guess the pins on the microprocessor were initializing to a low resistance state that did not allow for serial communication. This accounts for the odd 3.3 and 5V behavior and for the momentary data after and during resets.