Go Down

Topic: Garmin GPS (Read 3 times) previous topic - next topic

GekoCH

Jul 25, 2008, 02:34 pm Last Edit: Jul 25, 2008, 03:22 pm by GekoCH Reason: 1
Hello

So I got some troubles getting the right data from a Garmin GPS:
First I plugged the Garmin to the PC to get some NMEA Data:

$GPGGA,121638,4724.0053,N,00830.5565,E,1,04,4.0,510.6,M,48.0,M,,*48
$GPGLL,4724.0053,N,00830.5565,E,121638,A,A*43
$GPBOD,,T,,M,,*47
$GPBWC,121638,,,,,,T,,M,,N,,A*74
$GPVTG,222.4,T,221.7,M,0.0,N,0.0,K*4E
$GPXTE,A,A,,,N,A*51
$PGRME,16.8,M,12.3,M,20.8,M*1B
$PGRMZ,1659,f*3F
$PGRMM,CH-1903*44
$HCHDG,221.7,,,0.7,E*28

That was what he sent to me every second.

Now i saw that this line is important:
$GPGGA,121638,4724.0053,N,00830.5565,E,1,04,4.0,510.6,M,48.0,M,,*48

I used the GPS Tutorial on the Arduino Website but without any success.
I just changed the GPRMC to GPGGA and changed some parameters.
I plugged the TX from the Garmin to the Rx und the Ground to the Ground.
But as i started the Terminal nothing readable appeared...
Can someone help me


PS:
even with this code i just get:

v«Y«åë·q_[e{§S§§§§§§§§§§§§}§Y«?uåë·q_qq}§??----§--'?--£???§c§????£???§u§§?
§?£?§???£?§e§--£?§e§§«--?åë·q_qgg§--'?--£???§c§????£???§u§??----§S§Y«--}åë·q_{aw§
§W§§e§§«--'åë·q_{Qy§??----§§§§§§W§§e§§c§§Y«"åë·q_SWq§?£?§W§??£?§e§?£?§c§?£?§i«--
?åë·q_OWu§S§S§§§c§Y«--?åë·_q[eu§?£?§e§??£?§e§?'£?§e«}åë·_q[eK§"§3«??åë·_q[ee
§yo¥??«----åë·oyowq§??£?§§§?£'§u«??åë

Code: [Select]
int ledPin = 13;                     // LED test pin
int rxPin = 0;                       // RX pin
int txPin = 1;                       // TX pin
char incomingByte;

void setup(){
 pinMode(ledPin, OUTPUT);           // initialize LED pin
 pinMode(rxPin, INPUT);
 pinMode(txPin, OUTPUT);
 Serial.begin(4800);                // initialize Serial
}

void loop(){

 digitalWrite(ledPin, HIGH);        // switch LED on (debugging)
 
 if(Serial.available() > 0){        // send data only when you receive data
   incomingByte = Serial.read();    // read incoming
   Serial.print(incomingByte);      // send incoming
 }  
}



Thx
Geko

Grumpy_Mike

Just a thought, if you pluged your GPS into your Arduino you are connecting RS232 level signals into a TTL serial input.

One you might fry the Arduino and ...
Two it will be upside down (RS232 mark = -5 space = +5) (TTL mark = logic 1 = +5V space = logic 0 = 0V)

GekoCH

#2
Jul 25, 2008, 04:05 pm Last Edit: Jul 25, 2008, 04:08 pm by GekoCH Reason: 1
hmm ok so how I can check if It's fryed up? (is there an easy way to check this?)

Geko

PS:
But the strange thing is that I sometimes get the "right" data from the Arduino.
Sometimes I could read
$PGRMM,CH-1903*44
$HCHDG,221.7,,,0.7,E*28
but the $GPGGA wasn't there...

boardboy

Have you made sure that the Garmin GPS unit is outputting in NMEA?  I think the Garmin units default to the Garmin protocol which may explain the strange output.

GekoCH

Yes it does send the data in the NMEA protocol.
Does someone have experience with Garmin GPS?

Geko

dnear1

Which model Garmin GPS do you have?  What output does it have?  USB?  232?

kg4wsv

If you have a standard serial port on your Garmin (DB9 connector), you'll need an RS232 level translator circuit (MAX232, etc) to translate the RS232 voltages and levels to TTL voltages and levels for the Arduino.

-j


GekoCH

Thx a  lot so I'm gona buy one :)

GekoCH

Quote
Which model Garmin GPS do you have?  What output does it have?  USB?  232?


Its the GPSmap 76s and has a serial output...

lemming

You seem to be using the one hardware serial port of the arduino for receiving input from the GPS and sending the data to your PC. (The USB FDTI chip on the arduino uses pins 2 and 3 for serial communication with your PC). The problem could be further compounded by your GPS using a buad rate of 4800 on this port while your PC may be using the default 19200 on the same port. You should set up a second serial port (software serial library) for your GPS and use the hardware one for your PC, thereby enabling you to use two different baud rates and not mixing your input and output.

kBit

Quote
You seem to be using the one hardware serial port of the arduino for receiving input from the GPS and sending the data to your PC. (The USB FDTI chip on the arduino uses pins 2 and 3 for serial communication with your PC). The problem could be further compounded by your GPS using a buad rate of 4800 on this port while your PC may be using the default 19200 on the same port. You should set up a second serial port (software serial library) for your GPS and use the hardware one for your PC, thereby enabling you to use two different baud rates and not mixing your input and output.


You actually mean pins 0 & 1, right?
I agree, I think that is the problem.


GekoCH

Yeah it was the Converter from RS232 to a TTL signal. Now it does work, more or less....

I wrote a sketch that shows me the time on a LCD getting the data from the GPS. But the time
on the LCD is just updated every 2 seconds. Bu the data from the GPS is sent every second....
Why is there this delay of one second? Does the data processing take so long?

I used the Code from the Arduino Playground...

Geko

dokumentamarble

Yeah i just got my Garmin working also (garmin 35 series). Had to use the converter also. Is there a way to poll for the gps data?  Or do you just have to program it to wait for a full update to come through then continue on?

GekoCH

what do you mean by pool the data?

I got the sketch working from the playground. So it does display the data in a
usefull way.
Have you done the same? How fast does the new data appear on the serial?
I always got a 2 second delay...

Geko

dokumentamarble

Quote
what do you mean by pool the data?

Geko

In other words i want to ask the gps for the data then get it. not have to wait for it to refresh.

My gps updates at 1hz (once a second). Which is wondering if i could just continue on with the other part of my programming for my project, then when it needs gps just listen for the 1hz update.  Still id rather poll for the nmea output.

Go Up