Sparkfun GPS shield not playing nice on a Mega

Has anyone had success getting the Sparkfun GPS Shield to work on a Mega? At all?

I can't get a squeek out of any of the demo programmes on my Mega. Are there known issues with Mega compatability? I've heard about the Ethernet shield having issues.

I'm using the TinyGPS and NewSoftSerial libraries. Neither the Sparkfun quick start demo or the TinyGPS demo display out put from the GPS. I see the start up message, but I think I'm having issues with the software serial connection to the Mega.

The UART/dlink switch on the GPS shield is in the dlink position. softserial is set up like this

define RXPIN 3

define TXPIN 2

define GPSBAUD 4800

Beyond

GPS Shield QuickStart Example Sketch v12 ...waiting for lock...

I get diddly.

The NewSoftSerial and TinyGPS don't have much documentation.

Any idea's? My only option now is to get the storage CRO out of storage.

I’m using the TinyGPS and NewSoftSerial libraries.

You haven’t said anything about what else the Mega is doing, or how anything is wired, but I have to wonder why you are using a software serial port on a device that has 4 hardware serial ports.

I'm just trying to get the GPS talking. As to how it's wired?! It's a sparkfun gps shield, on an Arduino Mega! :)

I'd say it was definitely the soft serial, I've now gotten data from the gps, going in through uart1 or 0, I think I will use uart 3 on pins 14 & 15.

I would still like to see the softserial work though, using my mega embedded in a project is expensive overkill.

But taa anyway...

OK, desoldered the links, ran a jumper pair from the GPS shiel to Pins 14 & 15, works a treat!
I would still like to see the software serial work, I might get my VT132 out and try “plain text”

Here is Aaron Wiese’s Code with my Mega mod

[edit]/*
6-8-10
Aaron Weiss
SparkFun Electronics

Example GPS Parser based off of arduiniana.org TinyGPS examples.

Parses NMEA sentences from an EM406 running at 4800bps into readable
values for latitude, longitude, elevation, date, time, course, and
speed.

For the SparkFun GPS Shield. Make sure the switch is set to DLINE.

Once you get your longitude and latitude you can paste your
coordinates from the terminal window into Google Maps. Here is the
link for SparkFun’s location.
http://maps.google.com/maps?q=40.06477,+-105.20997

Uses the NewSoftSerial library for serial communication with your GPS,
so connect your GPS TX and RX pin to any digital pin on the Arduino,
just be sure to define which pins you are using on the Arduino to
communicate with the GPS module.
*/

// In order for this sketch to work, you will need to download
// NewSoftSerial and TinyGPS libraries from arduiniana.org and put them
// into the hardware->libraries folder in your ardiuno directory.
// Here are the lines of code that point to those libraries.
//
//
// 28/08/2010
// I could not get the NewSoftSerial Drivers to work
// on my Arduino Mega with the Sparkfun GPS shield.
// I desoldered the 2 jumpers, then jumpered the GPS’s Rx to Pin 14, Tx to Pin 15
// This is UART3
// As PaulS pointed out, why use soft serial on a board with 4 UART’s?
//
//
#include <TinyGPS.h>

//Set this value equal to the baud rate of your GPS
#define GPSBAUD 4800

// Create an instance of the TinyGPS object
TinyGPS gps;

// This is where you declare prototypes for the functions that will be
// using the TinyGPS library.
void getgps(TinyGPS &gps);

// In the setup function, you need to initialize two serial ports; the
// standard hardware serial port (Serial()) to communicate with your
// terminal program and another hardware serial port (Serial3()) for your
// GPS.
//
//

void setup()
{
// This is the serial rate for your terminal program. It must be this
// fast because we need to print everything before a new sentence
// comes in. If you slow it down, the messages might not be valid and
// you will likely get checksum errors.
Serial.begin(115200);
//Sets baud rate of your GPS
Serial3.begin(GPSBAUD);

Serial.println("");
Serial.println(“GPS Shield QuickStart Example Sketch v12.u”);
Serial.println(" …waiting for lock… “);
Serial.println(”");
}

// This is the main loop of the code. All it does is check for data on
// the RX pin of the ardiuno, makes sure the data is valid NMEA sentences,
// then jumps to the getgps() function.
void loop()
{
while(Serial3.available()) // While there is data on the RX pin…
{
int c = Serial3.read(); // load the data into a variable…
if(gps.encode(c)) // if there is a new valid sentence…
{
getgps(gps); // then grab the data.
}
}
}

// The getgps function will get and print the values we want.
void getgps(TinyGPS &gps)
{
// To get all of the data into varialbes that you can use in your code,
// all you need to do is define variables and query the object for the
// data. To see the complete list of functions see keywords.txt file in
// the TinyGPS and NewSoftSerial libs.

// Define the variables that will be used
float latitude, longitude;
// Then call this function
gps.f_get_position(&latitude, &longitude);
// You can now print variables latitude and longitude
Serial.print("Lat/Long: “);
Serial.print(latitude,5);
Serial.print(”, ");
Serial.println(longitude,5);

// Same goes for date and time
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
// Print data and time
Serial.print(“Date: “); Serial.print(month, DEC); Serial.print(”/”);
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time: “); Serial.print(hour, DEC); Serial.print(”:");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);
//Since month, day, hour, minute, second, and hundr

// Here you can print the altitude and course values directly since
// there is only one value for the function
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());
// Same goes for course
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
// And same goes for speed
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
Serial.println();

// Here you can print statistics on the sentences.
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
//Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
//Serial.println(); Serial.println();
}
[/edit]

This works really well, I’ll do the same mod with my XBee shield on Uart 2.