Dan, I'm waiting for your response on my latest PM . . .Originally Posted by Gonzzo
Dan, I'm waiting for your response on my latest PM . . .Originally Posted by Gonzzo
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Hi all,
I'm looking for a solution to capture NMEA data with a PIC micro and retransmit them on another serial interface... a kind of NMEA repeater.
My only problem is that fro example GPGAA sentences are not the same lenght:
$GPGGA,130524,4650.8982,N,01650.2497,E,0,00,,,M,,M ,,*5A
$GPGGA,170834,4124.8963,N,08151.6838,W,1,05,1.5,28 0.2,M,-34.0,M,,,*75
I try to mace something like:
......
dim GPGGA[i don't know the lenght] as byte
SERIN PORTB.0, 16572, [ WAIT( "$GPGGA," ) , STR GPGGA ] 'this would store the string if I would know its lenght
SEROUT PORTB.2, 16572, ["$GPGGA," , str GPGGA, 10, 13]
something like this... :-)
Please help me!!!
this is what i do for GPS data. (simplified, but this will work). NMEA sentences are ended with a CR, LF, so i loop through the data, checking for a CR, once its received i set a flag and pad with zeros. this gives me a constant length output of the complete NMEA sentence without chopping off any data. There are probably more efficient ways which dont add extra bytes, and the loop takes a bit of time, but at least it works
'record in 70 bytes
SERIN2 GPS_TXA, GBAUD, [wait("$GPGGA"),str GPGGA_IN\80]
'CLEAN UP THE GPGGA Read
CR_BYTE = 0
for i = 0 to 77
if GPGGA_IN[i] = 13 then
CR_BYTE = 1 'set flag that CR has been recorded
GPGGA_IN[i] = 160 'replace CR with a space
endif
if CR_BYTE = 1 then
GPGGA_IN[i] = 160 'pad with zeros
endif
next i
GPGGA_IN[78] = 13
GPGGA_IN[79] = 10
'END CLEAN GPRMC READ
Bookmarks