SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By PierreRosa
#70250
I am building a high precision clock with the EM-406A GPS module connected to a PIC18F4520 microcontroller; time, date and other interesting data are also displayed on a LCD.

The PIC18F4520 is correctly detecting the 1PPS signal coming out from the EM-406A and correctly receiving the NMEA sentences on its UART receive pin.

Can anyone tell me what is the time at the exact moment the 1PPS signal is serviced in the interrupt service routine programmed in the PIC18F4520?

From the specs, I read that when the 1PPS arrives, we are on the boudary of an UTC second within 1 microsecond precision. Is that correlated to the last time received from the last GPGGA NMEA sentence or is there no correlation at all (which would mean that the 1PPS is an idependant signal of the EM-406A not synchronized with the serial data coming out of its transmit pin)?

From many timing experiments I made, I have observed that the GPGGA sentence always occurs about 0.6 second before the following 1PPS; am I correct in interpreting that as follows: the time in the GPGGA sentence will be the exact time when the next 1PPS pulse arrives?

Thank you all.
By SecretSquirrel
#70284
The PIC has a three instruction cycle latency for interrupt execution. Depending on the synchronization of the processor clock and the interrupt, the latency will be either three or four instructions depending on when in the four clock instruction cycle the interrupt occurs.

ISR execution time will depend entirely on the instructions executed. You are probably going to need at least four instructions for saving the context, then whatever instructions you need to update your time values. The actual time required to execute can be computed based on crystal frequency and instruction cycles.

From the NMEA reference manual pointed to by SparkFun:

ZDA—SiRF Timing Message
Outputs the time associated with the current 1 PPS pulse. Each message is output within a few hundred ms after the 1 PPS pulse is output and tells the time of the pulse that just occurred.

The time included in an NMEA message is the current time as known by the GPS clock and the fractional seconds will represent the time since the last PPS signal. When processed, it will differ by some amount from the actual time due to the time taken to transfer the data over the serial line.

To set a clock based on an NMEA message, take the time given in the message and truncate any fractional seconds. Set the clock based on that value, then increment the seconds value for each following PPS signal. It obviously gets much more complex if you are trying to do sub-second timing as you are effectively looking at a software PLL at that point.

You experiment is correct, but in reality, the message is coming around 400ms after the last PPS signal.
By PierreRosa
#70294
The EM-406A does not support the GPZDA NMEA message....The only one suppored are GGA, GLL, GSV, RMC, VTG.

From my experiments, each PPS signal occurs more than half a second after the end of the preceeding GGA message; if, at the moment of the pulse I choose to increment this time before displaying it on my LCD, I am obviously one second in the future compared to other references clock I have (a GARMIN GPS, my PC clock synchronized with woldtimeserver.com and my watch).

So this would imply that the time is sent first (GGA message) then the PPS.

It is too late in my semester project to switch to SirF binary; so I will have to stick with NMEA without the ZDA mesage But I'm still in doubt..

I cannot conceive that all my references clock are l second late on the "real time" an at the same time consistent with one another.

An idea, anyone? Thank you.
By samcheetah
#79064
i am not receiving any PPS output from the EM-406A.

does anyone have any clue as to what could be the problem?

EDIT:

just figured out the problem. i was looking for the PPS output without a lock. now i got a lock and i am getting the PPS output