GPS w/ NMEA 0183 and Arduino Uno

I have a GPS that outputs NMEA 0183 standard with 5 wires coming out
Green, Orange, Yellow, Blue, Ground

Schematic from GPS for wire color

Right now i have ground hooked to ground
Orange to pin 0
Green to pin 1

When uploading the sketch from the link it tells me that BYTE is no longer supported. I changed BYTE to (Serial.write(byteGPS))
Original Code:
http://playground.arduino.cc/Tutorials/GPS

My Code:

 /*
 Example code for connecting a Parallax GPS module to the Arduino
 Igor Gonz?lez Mart?n. 05-04-2007
 igor.gonzalez.martin@gmail.com
 English translation by djmatic 19-05-2007
 Listen for the $GPRMC string and extract the GPS location data from this.
 Display the result in the Arduino's serial monitor.
 */ 
 #include <string.h>
 #include <ctype.h>
 int ledPin = 13;                  // LED test pin
 int rxPin = 0;                    // RX PIN 
 int txPin = 1;                    // TX TX
 int byteGPS=-1;
 char linea[300] = "";
 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];
 void setup() {
   pinMode(ledPin, OUTPUT);       // Initialize LED pin
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   Serial.begin(4800);
   for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }   
 }
 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100); 
   } else {
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                      
     Serial.print(byteGPS, (Serial.write(byteGPS))); 
     if (byteGPS==13){            // If the received byte is = to 13, end of transmission
       digitalWrite(ledPin, LOW); 
       cont=0;
       bien=0;
       for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
         if (linea[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<300;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... and the "*"
             indices[12]=i;
             cont++;
           }
         }
         Serial.println("");      // ... and write to the serial port
         Serial.println("");
         Serial.println("---------------");
         for (int i=0;i<12;i++){
           switch(i){
             case 0 :Serial.print("Time in UTC (HhMmSs): ");break;
             case 1 :Serial.print("Status (A=OK,V=KO): ");break;
             case 2 :Serial.print("Latitude: ");break;
             case 3 :Serial.print("Direction (N/S): ");break;
             case 4 :Serial.print("Longitude: ");break;
             case 5 :Serial.print("Direction (E/W): ");break;
             case 6 :Serial.print("Velocity in knots: ");break;
             case 7 :Serial.print("Heading in degrees: ");break;
             case 8 :Serial.print("Date UTC (DdMmAa): ");break;
             case 9 :Serial.print("Magnetic degrees: ");break;
             case 10 :Serial.print("(E/W): ");break;
             case 11 :Serial.print("Mode: ");break;
             case 12 :Serial.print("Checksum: ");break;
           }
           for (int j=indices[i];j<(indices[i+1]-1);j++){
             Serial.print(linea[j+1]); 
           }
           Serial.println("");
         }
         Serial.println("---------------");
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<300;i++){    //  
         linea[i]=' ';             
       }                 
     }
   }
 }

My code compiles and uploads fine as long as I do not have the GPS wired into the board. When its wired I get the error
avrdude: stk500_getsync(): not in sync: resp=0xe0

I’m stuck trying to get the GPS to output the normal NMEA strings. Not sure if it is wiring or code or both.
Any help would be greatly appreciated.

The RS-422 at the top is the correct schematic

This might answer my own question. It will not work unless I get a new GPS chip that is TTL. I believe the one i have is not TTL.

Is this correct?

Dear sir,

Please let me know following :

My code compiles and uploads fine as long as I do not have the GPS wired into the board. When its wired I get the error
avrdude: stk500_getsync(): not in sync: resp=0xe0

1)this problem occur when you have not selected proper board.
2) if your boot loader has crashed.

marc017:
I have a GPS that outputs NMEA 0183 standard with 5 wires coming out
Green, Orange, Yellow, Blue, Ground

Schematic from GPS for wire color

Right now i have ground hooked to ground
Orange to pin 0
Green to pin 1

When uploading the sketch from the link it tells me that BYTE is no longer supported. I changed BYTE to (Serial.write(byteGPS))
Original Code:
http://playground.arduino.cc/Tutorials/GPS

My Code:

 /*

Example code for connecting a Parallax GPS module to the Arduino
Igor Gonz?lez Mart?n. 05-04-2007
igor.gonzalez.martin@gmail.com
English translation by djmatic 19-05-2007
Listen for the $GPRMC string and extract the GPS location data from this.
Display the result in the Arduino’s serial monitor.
/
#include <string.h>
#include <ctype.h>
int ledPin = 13;                  // LED test pin
int rxPin = 0;                    // RX PIN
int txPin = 1;                    // TX TX
int byteGPS=-1;
char linea[300] = “”;
char comandoGPR[7] = “$GPRMC”;
int cont=0;
int bien=0;
int conta=0;
int indices[13];
void setup() {
  pinMode(ledPin, OUTPUT);       // Initialize LED pin
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(4800);
  for (int i=0;i<300;i++){       // Initialize a buffer for received data
    linea[i]=’ ‘;
  }  
}
void loop() {
  digitalWrite(ledPin, HIGH);
  byteGPS=Serial.read();         // Read a byte of the serial port
  if (byteGPS == -1) {           // See if the port is empty yet
    delay(100);
  } else {
    linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
    conta++;                      
    Serial.print(byteGPS, (Serial.write(byteGPS)));
    if (byteGPS==13){            // If the received byte is = to 13, end of transmission
      digitalWrite(ledPin, LOW);
      cont=0;
      bien=0;
      for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
        if (linea[i]==comandoGPR[i-1]){
          bien++;
        }
      }
      if(bien==6){               // If yes, continue and process the data
        for (int i=0;i<300;i++){
          if (linea[i]==’,’){    // check for the position of the  “,” separator
            indices[cont]=i;
            cont++;
          }
          if (linea[i]==’
’){    // … and the “*”
            indices[12]=i;
            cont++;
          }
        }
        Serial.println("");      // … and write to the serial port
        Serial.println("");
        Serial.println("---------------");
        for (int i=0;i<12;i++){
          switch(i){
            case 0 :Serial.print("Time in UTC (HhMmSs): ");break;
            case 1 :Serial.print("Status (A=OK,V=KO): ");break;
            case 2 :Serial.print("Latitude: ");break;
            case 3 :Serial.print("Direction (N/S): ");break;
            case 4 :Serial.print("Longitude: ");break;
            case 5 :Serial.print("Direction (E/W): ");break;
            case 6 :Serial.print("Velocity in knots: ");break;
            case 7 :Serial.print("Heading in degrees: ");break;
            case 8 :Serial.print("Date UTC (DdMmAa): ");break;
            case 9 :Serial.print("Magnetic degrees: “);break;
            case 10 :Serial.print(”(E/W): ");break;
            case 11 :Serial.print(“Mode: “);break;
            case 12 :Serial.print(“Checksum: “);break;
          }
          for (int j=indices[i];j<(indices[i+1]-1);j++){
            Serial.print(linea[j+1]);
          }
          Serial.println(””);
        }
        Serial.println(”---------------”);
      }
      conta=0;                    // Reset the buffer
      for (int i=0;i<300;i++){    //  
        linea[i]=’ ';            
      }                
    }
  }
}




My code compiles and uploads fine as long as I do not have the GPS wired into the board. When its wired I get the error
avrdude: stk500_getsync(): not in sync: resp=0xe0


I'm stuck trying to get the GPS to output the normal NMEA strings. Not sure if it is wiring or code or both.
Any help would be greatly appreciated.

main_c.zip (1.65 KB)

My code compiles and uploads fine as long as I do not have the GPS wired into the board. When its wired I get the error
avrdude: stk500_getsync(): not in sync: resp=0xe0

1)this problem occur when you have not selected proper board.
2) if your boot loader has crashed.

  1. No. It is because the GPS is trying to respond to the avr-dude communication with the Arduino.
  2. No. It is because the GPS won't shut up and let the bootloader respond.

Have u tried to upload the program without connecting GPS first.I think it is problem with boot loader.

I think this what you have done , you uploaded the program connected GPS and @ bottom your getting message saying that uploaded is successful.And you might thinking that ur program is compiled successfully.

check this:1) when you connect arduino board check whether tx and rx light are keep flickering or not. If yes that means your boot loader has crashed.provided donot connect GPS inputs

  1. if they are not flickering, Then u try to upload gps program without gps connected @ make ensure this time you dont get below message

avrdude: stk500_getsync(): not in sync: resp=0xe0

  1. try to put snap shot so people can understand the problems to resolve

if i am wrong let me know.

PaulS:

My code compiles and uploads fine as long as I do not have the GPS wired into the board. When its wired I get the error
avrdude: stk500_getsync(): not in sync: resp=0xe0

1)this problem occur when you have not selected proper board.
2) if your boot loader has crashed.

  1. No. It is because the GPS is trying to respond to the avr-dude communication with the Arduino.
  2. No. It is because the GPS won't shut up and let the bootloader respond.

I am still having this exact same problem. What is the solution? Is there any? What Are we doing wrong?

Which GPS model do you have? If it has real RS232 output, the outputs will be swinging +/- 5V or more, maybe +/-10V.
You need a RS232/TTL (0-5V level) converter to avoid smoking the '328P Rx pin.
Further, the TTL cannot be connected to D0/D1 if you are using the USB interface, the GPS output will interfere with the USB output. Software serial to another set of pins can be used.