Pages: [1]   Go Down
Author Topic: 2 months with the same problem GPS give rubbish with Arduino Uno.  (Read 1786 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,20*43
$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,N*02
$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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46042
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
NewSoftSerial nss (0,1);

void setup() {
  Serial.begin(115200);
  nss.begin(57600);
Pins 0 and 1 are the hardware serial pins. You are trying to use the same set of pins for two different purposes at two different speeds. That will never work. Connect the GPS to two different pins.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 169
Posts: 12441
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Crossposted , please remove all but one..
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: