Subject: Europa_Mail: Garmin GPS (fwd)
From: Paul
Date: 3/23/1999, 1:47 PM
To: zz

bryan.wilkinson wrote:



Can anyone help with information on the data  word format from Garmin GPS's?
viz; word length, stop bits, parity, levels, handshaking, inverted/non
inverted? ....
Baud rate is, I believe, 4.8kBaud.

many thanks
Dennis #333

______________________________________________________________________
The Europa List is supported by Aviators Network UK - info@avnet.co.uk

I think it is NEMA 0183 format.

Here is a short real time program that takes GPS data in from a
NEMA 0183 compatible GPS or Loran receiver and stores it on 
a hard disk.
 
This program will not work with Windows, OS/2 or any form of UNIX.
These operating systems do not allow direct hardware access or
real time interrupts. With Linux/UNIX you can probably treat the
interface
as just another ASCII terminal and redirect it to a file.

This has been tested with a Rockwell GPS receiver as used in an Arnav 
panel instrument and Lowrance boat units and a Long Ranger aircraft
Loran unit. It has also been tested with a Garmin handheld aircraft
GPS.

This requires at least QuickBasic which came with DOS 5.0 or DOS 6.22 
If you want it compiled you need QB 4.5 or Power Basic. 

  
CLS     'Clear the screen

'Recieve buffer size in bytes------+
'                              +   |
'Open buffer & wait for-+      |   |
'# of stop bits-----+   |      |   |
'# of bits -------+ |   |      |   |
'Parity --------+ | |   |      |   |
'Baud ------+   | | |   |      |   |
'Port #+    |   | | |   |      |   |
'      |    |   | | |   |      |   |   
OPEN "COM1:4800,N,8,2,OP15000,RS,RB32000,CD0,DS0,CS0" FOR RANDOM AS #1
OPEN "NEMA.DAT" FOR APPEND AS #2
TIMER ON

ON TIMER(2) GOSUB DoIt2
'        |
'Time ---+  

'Two seconds is the optimum. Anything less and you lose characters.
'Anything more and you get redundant sentences.
 
BackGround:    'Loop! Monitor the esc key press.

IF INKEY$ = CHR$(27) THEN GOTO EndItAll    'esc key

'Check to see if the program is running.
x = x + .00001
LOCATE 22, 19: PRINT x
GOTO BackGround

DoIt2:      'Do this every 2 seconds.
TIMER STOP    
CLS : LOCATE 22, 51 : PRINT "Press ESC to quit."
LOCATE 1, 1

DO WHILE NOT EOF(1)    'Do while there are characters in the buffer.
TempLine$ = INPUT$(LOC(1), #1)
PRINT TempLine$;       'Print it on the screen
PRINT #2, TIME$        'Time stamp the file on hard disk
PRINT #2, TempLine$    'Put the data in the file.
LOOP : TIMER ON : RETURN

EndItAll: CLS : CLOSE : SYSTEM

Here is a sample of the output data from a Long Ranger NEMA 0183 Loran;

00:06:00
$LCGLL,3031.91,N,08252.80,W
$LCBWC,,3500.00,N,12000.00,W,288,T,290,M,882.7,N,099
$LCAPA,A,A,9.85,L,N,V,A,349,M,099
$LCVTX,258,M,177,N

00:06:02
$LCGLL,3031.88,N,08252.91,W
$LCBWC,,3500.00,N,12000.00,W,288,T,290,M,882.6,N,099
$LCAPA,A,A,9.78,L,N,V,A,349,M,099
$LCVTX,258,M,177,N

00:06:04
$LCGLL,3031.82,N,08253.19,W
$LCBWC,,3500.00,N
00:06:04
,120
00:06:06
00.00,W,288,T,290,M,882.4,N,099
$LCAPA,A,A,9.58,L,N,V,A,349,M,099
$LCVTX,258,M,178,N


Here is a sample of the output data from an NEMA 0183 GPS. 
This data was gathered once a second.

$GPRMC,143724.266702,V,2606.386,N,08009.915,W,0000.0,000,200493,,,*3B
18:37:11

$GPRMB,V,,,,,,,,,,,,*30
18:37:12

$GPGGA,143725.266701,2606.386,N,08009.915,W,0,0,001,,M,00043,M,,,
18:37:13

$GPGLL,2606.38,N,08009.91,W,143725.266701
18:37:14

        +-time       +-Valid Data
        |            |  +-Lat      +-Long      +-Knots
        |            |  |          |           |     +-True Heading
        |            |  |          |           |     |    +-Date
$GPRMC,143726.266701,V,2606.386,N,08009.915,W,0000.0,000,200493,,,*3A
18:37:15

$GPRMB,V,,,,,,,,,,,,*30
18:37:16

$GPGGA,143727.266700,2606.386,N,08009.915,W,0,0,001,,M,00043,M,,,
18:37:17

$GPGLL,2606.38,N,08009.91,W,143727.266700
18:37:18

$GPRMC,143728.266700,V,2606.386,N,08009.915,W,0000.0,000,200493,,,*35
18:37:19

In the $GPRMC sentence the first number is the GMT time from the 
atomic clock in the sat accurate to the nearest microsecond!!!.


-The NMEA interface transmits data organized
-into sentences defined as follows:
-Sentence length is 20 bytes.
-Update rate = 1 Hz.
-Format parameters:
-Bytes are encoded as 7 bit ASCII characters in an
- 8 bit byte with the most significant bit set to zero.
-No Parity bit.
-One start bit and one stop bit.
-4800 baud.
-The total number of bits per transmitted data byte is 10.
 
The sentence is:
 
$HCHDM,
abc.d,M,*<checksumMS><checksumLS><cr><lf>

Where; 
a is the BCDhundreds digit of the heading. 
b is the tens digit. 
c is the ones digit. 

<checksumMS&gt is an ASCII character in the range 0-9 or A-F that 
                  represents the most significant nibble of the
checksum.

<checksumLS&gt  represents the least significant nibble.
 
The checksum is calculated by XOR'ing together all the
characters in the sentence up to... but not including the
"*" character. i.e. XOR together "S", "H", "C", "H",
"D", "M", ",(comma)", "hundreds digit", "tens digit",
"ones digit", ".(decimal point)", "tenths digit", ",(comma)",
"M", ",(comma)"]
 
The 'header information' -- the letters before
the actual data -- tells which of the ten or so
possible types of data that NMEA0183 can transmit.

  National Marine Electronics Association  (NMEA)
  PO Box 50040, Mobile, AL 36605
  Phone:  (205) 473-1793
  Fax:     (205)473-1669






Paul Lamar
 
The Aircraft Rotary Engine Newsletter.              Powered by Linux.

http://home.earthlink.net/~rotaryeng/            http://www.linux.org