GPS into a picaxe

trinity

New Member
Hi, I'm having a tough job getting this to work, so if any of you out there are using a picaxe connect and a GPS moduule, read on.

I want speed over ground in KPH and Altitude. I wrote the code below but it just sits there and waits, so it is not reading the data. I have looked with a scope, signal is there OK, on pin 16, but it won't budge. At this point I'm wondering if it is something silly, but I can't see what. If you have this set-up, or would like to comment, go ahead. The GPS is working fine with LSviewer and is set to only send these two 'words'.

init:

serout 6,N2400,(254,1) 'clear LCD
pause 30
serout 6,N2400,(254,128,"Chip running")
pause 1000
serout 6,N2400,(254,1) 'clear LCD
pause 30

main:
serout 6,N2400,(254,128,"Main Loop start")
Pause 1000
serout 6,N2400,(254,1) 'clear LCD
pause 30
serin 7, N4800, ("$GPVTG,"), b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b1,b2,b0,b4
'total of 26 charcaters to dump before the data we actuall need, KPH up to 99.9!!
serout 6,N2400,(254,128,"KPH=",#b1,#b2,".",#b4) 'show it on LCD
Pause 100 'now do the elevation buried behind 48 b0's!!
serin 7, N4800, ("$GPVTG,"), b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b0,b1,b2,b0,b4
serout 6,N2400,(254,128,"KPH=",#b1,#b2,".",#b4) 'show it on LCD
pause 100
goto main
HELP!!!

Gareth
 

BeanieBots

Moderator
Posting in the main forum will get you more responses.
You have a line which reads in the unwanted data which is followed by a serout and a pause 100. If the GPS is sending data during this time, then the next time you do serin, it may well be in mid flow of the data stream.
Try without the pauses.
 
Top