GPS Valid Fix Detector

Code for this Microchip PIC project was developed to provide a simple solution
for determining whether a GPS receiver NMEA output is presenting valid fix data.

A single 8-pin chip is all that is needed if the receiver delivers CMOS voltage levels.
If true (bipolar) RS-232 data is provided, an inverter must be added.

If the GPS fix is valid, denoted by the character "A" in position 14 of string GPRMC,
the "OK Fix" pin is set high to illuminate a green LED.

If the receiver is providing serial data, but has not yet declared a valid fix or if a valid
fix changes to invalid, a yellow "No Fix" warning LED is illuminated.

If the serial data stream is lost for more than two seconds, the watchdog timer resets
the chip, setting the "No Data" pin to illuminate a red LED.

Not all GPS receivers send the "A" character as the 14th in the string. If your receiver
differs (values of 17 and 18 are known to exist), the source code must be modified.
Looking for the character following the second "," in the string would be more general
and is left as an excercise for the reader.

A more correct algorithm would take the complete string, recalculate the check-sum
and compare it to the one sent before using any data in the string.

Comments in the SourceBoost BASIC code offer insight into the design which uses
22 of the 64 bytes of RAM and 105 of the 1024 bytes of ROM in the 12F629.

'****************************************************************
'                                                               *
'                         12F629                                *
'                       +---------+                             *
'                     1 |         | 8                           *
'           +5.0 V  ----+         +----  GND                    *
'                     2 |         | 7                           *
'    Serial In GP5  >---+         +--->  GP0 "No Data" LED Out  *
'                     3 |         | 6                           *
'              GP4  <---+         +--->  GP1 "No Fix" LED Out   *
'                     4 |         | 5                           *
'              GP3  >---+         +--->  GP2 "OK Fix" LED Out   *
'                       |         |                             *
'                       +---------+                             *
'                                                               *
'****************************************************************

CodeView Source Code LibraryView Library File Hex File View Hex File