PDA

View Full Version : Help with Motorola GPS



DanPBP
- 31st January 2005, 15:20
Hello,

I'm working on a school project where I'm reading data from a Motorola Oncore GPS with a 16F84 PIC and showing the GPS string on a 2x20 character LCD.

I tried everything but I cannot make it work. I know that the module sends binary information by default and I have to send some commands to change it to NMEA, I tried that but no luck.

Does anyone have a working source code for this GPS? I only need the configuration and reception strings, that's all.

Thank you very much.

Best regards,
Daniel.

mister_e
- 31st January 2005, 16:10
can you post your code and datasheet for your Motorola GPS module ? That way we can see what's wrong or, have some idea to make it work

mike
- 19th February 2005, 15:10
I presume you are using the moto oncore
this module defaults to moto protocol at startup, you will need the software to reprograme the modele for NEMA output at 4800 baud , check their web site for the download
let us know if you can see the nema output using hyperterminal etc, i have some code to do what you are asking ,,,but not to hand

rdg MIke

mike
- 19th February 2005, 20:20
'Set LCD Data port
DEFINE LCD_DREG PORTC
'Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port, bits 4-7 of portc
DEFINE LCD_RSREG PORTC
'Set LCD Register Select bit
DEFINE LCD_RSBIT 1
'Set LCD Enable port
DEFINE LCD_EREG PORTC
'Set LCD Enable bit
DEFINE LCD_EBIT 0
'Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
'Set number of lines on LCD
DEFINE LCD_LINES 2
'Set command delay time in us
DEFINE LCD_COMMANDUS 2000
'Set data delay time in us
DEFINE LCD_DATAUS 50
year var byte
month var byte
day var byte
time var word
sec var byte
warn var byte 'receiver warning - A = ok, V = warning
deglat var byte 'degrees of lattitude dd
minlat var byte 'minutes of lattitude mm
fracminlat var word '.mmmm
nslat var byte 'North or South lattitude
deglon var byte 'degrees of longitude dd
minlon var byte 'minutes of longitude mm
fracminlon var word '.mmmm
welon var byte 'West or East longitude
knotgndspd var word 'Groundspeed in Knots read from GPS
groundspeed var word 'in MPH
heading var word 'In true degrees
magvar var byte 'Magnetic Variation
magdir var byte 'Direction of Magnetic Variation
sats var byte 'Number of Satilites in use
calalt var word 'Altitude MSL in feet after conversion
metalt var word 'Altitude in meters from GPS
fracalt var byte
speedfrac var byte
lcdout $fe,1
ReadGPS:

SERIN2 PORTb.7,188,3000,NoData,[WAIT("$GPRMC,"),dec4 time,dec2 sec,skip 4,warn,skip 1,_
dec2 deglat,dec2 minlat,skip 1,dec4 fracminlat,skip 1,nslat,skip 1,_
dec3 deglon,dec2 minlon,skip 1,dec4 fracminlon,skip 1,_
welon,skip 2,dec3 knotgndspd,dec heading,skip 2,dec2 day,dec2 month,dec2 year]

'SERIN2 PORTb.7,188,2000,NoData,[WAIT("$GPGGA,"),skip 33,dec sats,_
'skip 4,dec metalt]

SERIN2 PORTB.7,188,2000,NoData,[WAIT("$GPGGA,"),skip 37,dec sats,_
skip 4,dec metalt,dec fracalt]
if warn="V" then goto nodata
Goto Send

NoData:
'Make the Navigation Warnig variable V
warn = "V"
lcdout $fe,1
lcdout $FE,2,"Invalid GPS Data"
pause 500
goto ReadGPS
'knotgndspd = knotgndspd * 115
groundspeed = DIV32 100
Send:
lcdout $fe,1
lcdout $FE,2,dec2 deglat,",",dec2 minlat,".",_
dec4 fracminlat,",",nslat," ",dec3 deglon,",",dec2 minlon,".",_
dec4 fracminlon,",",welon," head ",dec3 heading

lcdout $fe,$c0,dec4 time,":",dec2 sec," ",dec2 day,"/",dec2 month,"/",dec2 year," Alt "_
,dec3 metalt,".",dec fracalt," speed ",dec knotgndspd
Goto ReadGPS


hope this helps rdg Mike

DanPBP
- 14th June 2006, 10:47
I've been away for a while, and I didn't have the chance to say thanks!

Thanks for your help!

Daniel.