We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hey all,
I am doing a project on Vehicle Tracking System using GPS and GSM Modem.The 2 devices aforementioned communicates with 8051uC. But since there is only 1 UART in 8051 i have to use a analog multiplexer i.e CD 4062. I want to know how to interface it with GPS, GSM, and 8051.
Also it would be grateful if anyone could tell me how to parse output of GPS and how initialize a GPS receiver to that it starts giving me the GPRMC
So. Now you asked a specific question.
One possible route (and the possibilities are legio):
char my_nmea_string[NMEA_BUF_SIZE]; if (!strncmp(my_nmea_string,"$GPRMC",6)) { // almost there. just continue to gnaw characters // one at a time until reaching end of string ... }
Or you can have the interrupt code (normally not so good idea but depends on what interrupt load you have, and timing requirements) have a state machine and process each receievd character based on current state. If currently waiting for a number you just check if character is field separator or part of the number.
Whatever you do, you just have to process the received data character-by-character. Optionally after having collected a full text line in a buffer (and possibly verified the checksum). Just remember that the line break and the $ can be very handy for synchronizing if you start listening in the middle of a line.
About processors with multiple UART - check parametric search on this web site. Finds a lot of chips with multiple UART:
And you are correct that the parsing of a $GPRMC string looks similar even with different GPS - I already mentioned that earlier. So your general skills at programming should be able to solve the problem. Most C solutions that works on a PC would work on a 8051 too for the specific case of handling an $GPRMC string. And it's quite easy to process the $GPRMC string in assembler to.
A creative developer sees possibilities. What possibilities have you identified?