2 months with the same problem GPS give rubbish with Arduino Uno.

Hello brave sparkies
I should better cut the long story short. So, I interfaced the GPS with the arduino Uno using the serial port (0, 1). my goal is to reveice data from GPS.

I wrote a few codes with the help of www.arduino.cc but I face the same problem at the end.
I do receive data but the problem is they are all rubbish. here is the code I used for the last one, which is not mine... I just copy from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1280535694

#include <NewSoftSerial.h>
NewSoftSerial nss (0,1);

void setup() {
Serial.begin(115200);
nss.begin(57600);
}

void loop() {
if(nss.available()) {
Serial.print(nss.read(),BYTE);
}
}

What I received on the serial monitor is something close to ÆÑÙÝ-àÆÆÆ-ÉÎü,ÿÿÆÆññÆÆÆ
and bunches of different rubbish.

With the same GPS reciever I get this on the hyper terminal on the computer.

$GPGSV,1,1,01,09,00,000,2043
$GPRMC,184045.000,V,0000.0000,N,00000.0000,E,000.0,000.0,010411,,,N
7F
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N02
$GPGGA,184046.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,0.0,M,,0000
62
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30

beside I have a second GPS receiver that behave exactly like the first one on the arduino UNO and on the hyper terminal (for those of you who has Window XP).

I investigated for quite sometime now (at least 2 months) and I think I do not have a clue of what do next anymore.
I tried to change the parity, stop bit and data lenght and different stuff with no avail.

at the end I suspected that the code I wrote was not correct so I used someone else code that worked (the one up there). it gives me exactly the same rubbish like any other algorithm.

from the troubleshooting I have done so far, I know for sure that the problem is from the microcontroller atmega328 (arduino). is it the programming? is it the parity, stop bit, data length?

can anyone provide me a code to set up the parity, stop bit and data lenght. I have done it but I am not certain that it was the right way.

should one point me in the right direction, it will be desperately appreciate.

(deleted)

With the same GPS reciever I get this on the hyper terminal on the computer.

What hardware and configuration are you using to read from the receiver on the computer?
(A "serial port" designed to connect to the 9-pin connector on most PCs and USB/Serial converter modules is NOT suitable for connecting directly to Arduino. You need an "rs232 level converter" or similar.)
(and I though the "standard" speed for GPS things was 4800bps.)
(either of those issues would cause pretty much exactly the symptoms you are seeing.)

I investigated for quite sometime now (at least 2 months) and I think I do not have a clue of what do next anymore.
I tried to change the parity, stop bit and data lenght and different stuff with no avail.

Everything except the baud rate....

It looks like it may be another 2 months before he checks back here for an answer. Maybe he's checking the cross-posts.

Don

will2is:

#include <NewSoftSerial.h>

NewSoftSerial nss (0,1);

That's your mistake. You can't run NewSoftSerial AND hardware serial on the same two pins!

Pick two OTHER pins for NewSoftSerial.

Multiple cross-posts.
Another one for the blacklist

Thank you for your answers...

That's your mistake. You can't run NewSoftSerial AND hardware serial on the same two pins!

Pick two OTHER pins for NewSoftSerial.

I changed the port but I get exactly the same rubbish

Spycathcer
The GPS receiver I use is defaulted to 9600. and can use the 115200 baud rate and some more. I checked the datasheet. so on the hyper terminal it was set on 9600.

Hello Westfw

I am using the max232 with the GPS S1315R. the GPS work with 9600bps which I used on the hyper terminal. in fact when I connect to the hyper terminal it does not do through the arduino and the result is great. I get the format I want. but through the arduino it is just something else... pretty much nonsense....

since everything work well with the hyper terminal... the conclusion is that there is no problem with the connections.

sorry to disappoint you, the baud rate was ok... during investigation that's the reason I have not mention it

in fact when I connect to the hyper terminal it does not do through the arduino and the result is great

These Google translations aren't great - could you maybe get someone who speaks English to help you?

Your symptom looks like a baud rate mismatch.

How does the GPS determine what baud rate to use?

Your symptom looks like a baud rate mismatch

I am using the max232 with the GPS S1315R

Sounds more like the max232 is still in-circuit to me.

Maybe the OP will enlighten us.

see below the code I normally use to do get the information from the GPS.

The way you guys mention about the baud rate I feel like Serial.begin(9600); is not enough of a initialisation of a baud rate...?

what else should I do then if it is the case?

the code is a bit different that the first one.

void setup()
{
lcd.begin(16, 4);
pinMode(rxPin, INPUT);
Serial.begin(9600);
}

}

void loop()
{
if (Serial.available() > 0)
{
// read the incoming data:
incomingdata = Serial.read();

if (incomingdata)
{
j = 0;
dataRead[j] = incomingdata; // include each char read to the array

dataRead[j+1] = '\0';
Serial.print(dataRead[j]);
j++;
}
}
else
{
Serial.print("Not found \n");
delay(1000);
}

}

There is a small mistake of } on the last message I posted... pls disregard.

Well so far we do not have a link to the data sheet for the device, we do not have an adequate unambiguous description, photograph, or diagram of the interconnections, and we do not have a copy of all of the code. Otherwise we have everything we need to provide an intelligent response to his questions.

Don

will2is:
There is a small mistake of } on the last message I posted... pls disregard.

Why don't to fix it? There is a "modify"-button to edit previous posts.

Cheers,
Kari

You should connect the GPS to pins other than 0 and 1 - so connect them to pins 2 and 3 and use newSoftSerial to talk to the GPS. From a quick google search it looks like you should be using 9600 as the rate.

Also, the Serial function is so you can talk to the IDE via the debugger and you can't overlap it with the GPS. You need Serial to talk to the debugger and NewSoftSerial to talk to the GPS.

So you need two serial functions like so:

#include <NewSoftSerial.h>

NewSoftSerial nss(2,3);

void setup() 
{
  lcd.begin(16, 4);            
  pinMode(rxPin, INPUT);
  Serial.begin(9600);         // for the debugger
  nss.begin(9600);           // for the GPS on pins 2 and 3
}

I tracked down a copy of the SkyTraq S1315F (FLASH version of the S1315R ROM version)

It says 9600 baud.

thanks for you replies,

Daneel, I will try what you said and update you as soon as it is finished