Switched from Arduino UNO to Mega, none of the modules initialize.

Had a SD card, IMU, and Fona GPRS connected to an Uno. All worked as expected. Switched to Mega and I can't get any of them to initialize. I'm not sure what the problem is, I don't think the pin layout would change and switching them from 1 board to another would be identical. I switched the IDE to the Mega, Is there anything else I need to change?

When I run my sketch on the mega, it uploads the code correctly but the SD card, nor GPRS ever make it past initializing. I also try test sketches and none initialize. It makes me think the wiring is wrong, but plugging the Fona board in one Arduino to another shouldn't change anything.

Any Help?

// The SFE_LSM9DS1 library requires both Wire and SPI be
// included BEFORE including the 9DS1 library.
#include <Wire.h>
#include <SPI.h>
#include <SparkFunLSM9DS1.h>
#include "SdFat.h"


//////////////////////////
// LSM9DS1 Library Init //
//////////////////////////
// Use the LSM9DS1 class to create an object. [imu] can be
// named anything, we'll refer to that throught the sketch.
LSM9DS1 imu;
SdFat SD;
const uint8_t chipSelect = SS;
#define SD_CS_PIN SS

#define error(s) SD.errorHalt(PSTR(s))
ArduinoOutStream cout(Serial);
#include "Adafruit_FONA.h"

// GPS
float latitude;
float longitude;
float kph;
boolean gpsSuccess;

float mmms;
float distance;

float z;
float x;
float y;
float xy;
unsigned long timeStart;
unsigned long time2;
unsigned long time3;
File myFile;


// We default to using software serial. If you want to use hardware serial
// (because softserial isnt supported) comment out the following three lines 
// and uncomment the HardwareSerial line
#include <SoftwareSerial.h>
SoftwareSerial fonaSS = SoftwareSerial(3, 2);
SoftwareSerial *fonaSerial = &fonaSS;

// Hardware serial is also possible!
//  HardwareSerial *fonaSerial = &Serial1;

Adafruit_FONA fona = Adafruit_FONA(4);

Quick Addition

I think my pin setup in the code is wrong, but I’m not sure which ones or if all of them need to be changed. The above code is the working code for the UNO.

It would help if you showed us how you had it wired, there are differences in the functions of some pins on the UNO that are in the same location as those on the Mega.

srnet:
It would help if you showed us how you had it wired, there are differences in the functions of some pins on the UNO that are in the same location as those on the Mega.

Ah I think I have made an error, I don't have the 2560 rev3, just the old 2560. the MISO,MOSI, etc pins are on the perpendicular section of board as opposed to parallel side. Everything is already sautered to the Fona board so I think I am SOL for what I'm trying to do.

HardwareSerial *fonaSerial = &Serial1; // uncomment (use) this, and comment/remove the three SoftwareSerial lines.
Then use the Serial1 pins (18,19) on the Mega.

MISO/MOSI/SS are on pin 50,51,53.
Google "Arduino Mega pinout" (images).
Leo..