Weird Problem

I have just got working a 6mv2 GPS Working. It works with a modified tinygps library which I found online.
I was able top out put the lat long of the co ord of my house. QUite cool.

Today I turned on my device and it was timing out constantly. I swapped RX TX several times with still no luck. I then decided to use two differnt pins (went from 10 and 11) to 8 and 9. Now i can get data back. But I get a load of rubbish. eg:

«	¹¾­))IZj+Jé©h:øó?V!?Bé)?

??O

Now I tried other IO pins with the software serial and still hit the same problem. Another problem I have noticed I get time out when switching the RX and TX wires with software also switched. I am not too sure whats gone wrong ? (software serial running at 4800).

Code ?

#include <SPI.h>
#include <avr/pgmspace.h>
#include <SoftwareSerial.h>
#include <TinyGPS_UBX.h>
#include <SD.h>

SoftwareSerial GPS_Serial(9, 8);
TinyGPS gps;

#define DEBUG true

byte gps_hour, gps_minute, gps_second;
long gps_lat, gps_lon;
unsigned long gps_fix_age;
int valid;

// no need to store these in the RAM anyway
static char str_buffer[25];
prog_char GPSstr_poll[] PROGMEM = "$PUBX,00*33";
prog_char GPSstr_setup1[] PROGMEM = "$PUBX,40,ZDA,0,0,0,0*44";
prog_char GPSstr_setup2[] PROGMEM = "$PUBX,40,GLL,0,0,0,0*5C";
prog_char GPSstr_setup3[] PROGMEM = "$PUBX,40,VTG,0,0,0,0*5E";
prog_char GPSstr_setup4[] PROGMEM = "$PUBX,40,GSV,0,0,0,0*59";
prog_char GPSstr_setup5[] PROGMEM = "$PUBX,40,GSA,0,0,0,0*4E";
prog_char GPSstr_setup6[] PROGMEM = "$PUBX,40,GGA,0,0,0,0*5A";
prog_char GPSstr_setup7[] PROGMEM = "$PUBX,40,RMC,0,0,0,0*47";
PROGMEM const char *str_table[] = {
  GPSstr_poll, GPSstr_setup1, GPSstr_setup2, GPSstr_setup3, 
  GPSstr_setup4, GPSstr_setup5, GPSstr_setup6, GPSstr_setup7
};
File myFile;

void setup() {
  Serial.begin(4800);
  pinMode(4, OUTPUT);
  if (!SD.begin(4)) {
    Serial.println("Error With Card");
    return;  
  }
  GPS_setup();
  Serial.println("we are go!");
}

void loop() {
  GPS_poll();
  gps.crack_time(&gps_hour, &gps_minute, &gps_second, &gps_fix_age);
  gps.get_position(&gps_lat, &gps_lon, &gps_fix_age);
  char time[8];
  sprintf(time, "%02d:%02d:%02d", gps_hour, gps_minute, gps_second);
  Serial.println();
  Serial.print("time: "); 
  Serial.println(time);
  //Serial.print("latitude: "); Serial.println(gps_lat, DEC);
  //Serial.print("longitude: "); Serial.println(gps_lon, DEC);
  Serial.print("latitude: "); 
  Serial.println(gps_lat/100000.0, 5);
  Serial.print("longitude: "); 
  Serial.println(gps_lon/100000.0, 5);
  Serial.print("altitude: "); 
  Serial.print(gps.altitude()/100.0, 0); 
  Serial.println(" m");
  //Serial.print("speed: "); Serial.print(gps.speed()/100.0, 0); Serial.println(" km/h");
  Serial.print("speed: "); 
  Serial.print(gps.f_speed_kmph(), 2); 
  Serial.println(" km/h");
  Serial.print("vert. speed: "); 
  Serial.print(gps.vspeed(), DEC); 
  Serial.println(" cm/s");
  Serial.print("bearing: "); 
  Serial.println(gps.course()/100, DEC);
  Serial.print("satellites: "); 
  Serial.println(gps.sats(), DEC);
  Serial.print("has fix: "); 
  Serial.println(gps.has_fix(), DEC);
  Serial.print("fix quality: "); 
  Serial.println(gps.fix_quality(), DEC);
  Serial.print("fix age: "); 
  Serial.println(gps_fix_age, DEC);
  Serial.println("------------");

  myFile = SD.open("data.csv", FILE_WRITE);


  if (myFile) {
   
    Serial.println("Writing Data ....");
    myFile.print(time);
    myFile.print(",");
    myFile.print(gps_lat/100000.0, 5);
    myFile.print(",");
    myFile.println(gps_lon/100000.0, 5);
    myFile.close();
    Serial.println("Complete!");
    } 
  else {
    // if the file didn't open, print an error:
    Serial.println("Failed to write to file.");
  }

  
  delay(5000);
}


void GPS_setup() {
  GPS_Serial.begin(4800);
  // switch baudrate to 4800 bps
  //GPS_Serial.println("$PUBX,41,1,0007,0003,4800,0*13"); 
  //GPS_Serial.begin(4800);
  //GPS_Serial.flush();

  delay(500);

  // turn off all NMEA sentences for the uBlox GPS module
  // ZDA, GLL, VTG, GSV, GSA, GGA, RMC
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[1])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[2])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[3])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[4])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[5])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[6])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[7])));

  delay(500);
}

// request uBlox to give fresh data
boolean GPS_poll() {
  //GPS_Serial.println("$PUBX,00*33");
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[0])));
  delay(300);
  unsigned long starttime = millis();
  while (true) {
    if (GPS_Serial.available()) {
      char c = GPS_Serial.read();
#if DEBUG
      Serial.print(c);
#endif
      if (gps.encode(c))
        return true;
    }
    // that's it, can't wait any longer
    // i have short attention span..
    if (millis() - starttime > 1000) {
#if DEBUG
      Serial.println("timeout");
#endif
      break;
    }
  }
  return false;
}

It seems almost the gps chip is now running at a different speed? Im totally confused.

Have you tried different baud rates for the GPS connection ?

Thanks for your help, i tried it and found out you have to switch to 4800 after being 9600. Thank you.