polling information in rs-232
Hi all,
i'm new to your community and in search of a (probably) simple answer to my problem.
pardon my inexperience, but to learn i guess the best way is to start asking for help (after doing a big search everywhere; OF COURSE ).
my problem:
i have a strip of data from a gps unit in NMEA
$GPGGA,150126,4521.3660,N,07317.9876,W,1,03,102.3, ,,-032.30,M,,*1D
i use a 16f877a (to receive it's no problem)
the problem is that i want to re-send that information ($GPGGA, etc....) every second while i still watch the next incoming data.
here's a simple example:
' This will set the serial port 4800
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 4800
GPS VAR byte
char var byte
main:
' receive from GPS unit
Hserin [char] ' <- works!
GPS = GPS + char '<<<< that part is causing the problem >>>>
' send to computer
hserout [GPS]
goto main:
what i really want to achieve is that the part "hserout [char]" would transmit to the PC every second while i still check the incoming "Hserin [char]" from GPS unit
i know there might be a much simpler way to do this, so i need a bit of your experience please.
Tried to lower the baudrate, tried with interrupt, etc... the "GPS = GPS + char" cause some garble characters in the receiving process...
If i use a LOOP in the "hserout [GPS]" i prevent the reception of new data from GPS unit.
there might be a way while reading the RECREG , but i don't know how....
Awaiting your help
Extracting position rom GPS data stream
Have a look at
http://www.picbasic.co.uk/forum/showthread.php?t=5423
where you will see an example of reading the NMEA data stream, putting the selected string into an array and extracting the wanted fields.
You will normally NOT want to retransmit the entire NMEA stream, but instead just selected fields.
HTH
Brian