Here is a program called "earthbridge" that takes a serial GPS data stream and plots it on Google Earth.
http://mboffin.com/earthbridge/
I don't think it is being developed any more (no new revisions for several years)
I have used it to recieve gps coordinates over an XBEE wireless connection and plot it on google earth.
I had a PIC (12F683) connectd to the GPS module and parsing the data and then sending it to my PC via the XBEE link.
On the PC end I just had the XBEE radio connected to the PC via an FTDI USB to Serial converter.
Here is the code I was using in the PIC...
Code:
@ device pic12F683, intrc_osc_noclkout, BOD_OFF, PWRT_OFF, wdt_off, mclr_off, protect_off
DEFINE ADC_BITS 8 ' Number of bits in ADCIN result
define ADC_CLOCK 3 'SET CLOCK SOURCE TO RC = 3
DEFINE ADC_SAMPLEUS 50
' -----[ Initialization ]------------------------------------------------
Reset:
CMCON0 = %00000111 ' Comparators off
TRISIO = %101100
ADCON0 = %00001100 ' LeftJust,VDD,x,x,AN3,x,ADCdisabled
ANSEL = %0010000 ' -001xxxx Fosc/8, -xxx0000 all pins digital not analog
IOC = %001000 'enable gpio.3 interrupt on change
'NOTE: you must also clear the CONFIG.5 fuse bit to change gpio.3 to
'an I/O instead of MCLR (its under the configuration link on the
'pickit2 programing app. This bit must be done each time before you
'program the chip.
OPTION_REG = %10111111 'b7=pullups disabled
'b6=int on falling edge
Xpwr var gpio.0 'Output to turn on XBee
XBrx var gpio.1 'Output serial data to XBee
XBtx var gpio.2 'Input
rst var gpio.3 'Input
Gpwr var gpio.4 'Output to turn on GPS
GPS var gpio.5 'Input serial data from GPS
symbol I = 254 'LCD prefix for Instruction
symbol clr = 1 'LCD CLEAR SCREEN
SYMBOL LINE2 = 192 'LCD ADDR FOR 1ST CHAR ON 2ND LINE
SYMBOL H = 2 'LCD HOME COMMAND
NMEA1 VAR BYTE[35]
NMEA2 VAR BYTE[35]
FN var byte ' For Next loop counter variable
'============= Main Program ==========================================
Main:
high gpwr 'turn ON GPS module
pause 5000
GPSin:
for fn = 0 to 5
SERIN2 GPS,188,1500,tmout,[WAIT("$GPRMC,"),WAIT("A")]
serin2 gps,188,3000,tmout,[WAIT("$GPGGA,"),STR NMEA1\35,STR NMEA2\35\"$"] 'Data IN from GPS
next
low gpwr 'Turn OFF GPS module
high xpwr 'Turn ON XBEE radio
pause 500
SEROUT2 xbtx,188,[$0D,$0A,"$GPGGA,",STR NMEA1\35,STR NMEA2\35] 'Data OUT to XBEE
pause 500
low xpwr 'Turn OFF XBEE radio
pause 5000
goto main
'-----------subroutines-------------------------
NoFix:
high xpwr
pause 500
serout2 xbtx,188,[13,10,"X"] ' send X's while waiting for satelite fix
low xpwr
goto gpsin
tmout: 'end up here if no data from gps within 3 seconds
high xpwr
pause 500
serout2 xbtx,188,["timeout"]
low xpwr
GOTO MAIN
The code is a bit rough... I wasn't actually using the ADC yet the code contains setup for the ADC.
Also the CINFIG is the old style and needs to be updated for newer PBP
I can post a schematic if you want it.
The GPS/PIC/XBEE combination was powered by a single Lithium ion cell (old cell phone batt)
And was designed to track my dog around the yard so I could see where he went.
Bookmarks