hello,
how can i receive gps transmission with the serial port and analyze the date and time and store it in the program memory (c language) ?
the gps is communicatin with the following port configuration:
1200 baud 7 bit ascii odd 1 stop bit
the gps telegram is: FDDD<c1>HH<c2>MM<c3>SS<c4>mmmQ F - gps mode <c1> - character between day and hour <c2> - character between hour and minute <c1> - character between minute and seconds Q - character fot time quality
thanks in advance.
Are you sure that the GPS sends that data?
Most GPS sends NMEA data.
But I'm not really sure what you are asking about.
You initialize the serial port - several examples available.
You either split the serial data character-by-character directly when received or wait until you get an end-of-message character - normally a line ending - and then split the message into it's individual fields.
What you then do with the extracted data is completely up to your needs.
what can i do, this is the gps i must connect to. i know how to configure the serial port to receive the gps data, no problem.
the problem is that my gps don't send the year. i also want my project to include a real time clock chip but i'm kind of new to program it. is it possible to retrieve the year from the RTC or i must calculate it ? my project is a 'date & day name & time' sign that connected to gps and when the gps are down the RTC is still "kicking" the clock. another thing, when i power on the clock and there are no gps the RTC is incharge of the date time and day of the clock. my question is does the RTC know the year ? where can i learn how to program it with C ? i've notice there are many RTC's in the market, which one of them is the most suitable ?
The GPS should be able to send the year, but not the century.
But if you have a GPS that doesn't send NMEA data, then you have to either post the name of the GPS and see if someone else knows anything about it, or google for the name and see if you can find any information.
The RTC should have a year field - but you must first set it of course. You need to read the datasheet for the RTC. And you need to learn C. Combine that knowledge, and it should be trivial to program an RTC. There are many RTC on the market, and very many of them are suitable. The question is how long time you must be able to keep the time. If it is enough to keep it a couple of hours, then you can often manage with the RTC that a lot of microcontrollers has. If you need to keep it for a couple of months up to a couple of years, then you could go for an external RTC with a separate Li-Mn coin-type battery.