Pages: [1] 2   Go Down
Author Topic: Garmin GPS  (Read 2327 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: July 25, 2008, 08:22:23 am by GekoCH » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31452
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: July 25, 2008, 09:08:42 am by GekoCH » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Geko
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx a  lot so I'm gona buy one smiley
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Central Florida, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: