manufacturer of I/O-rich SBCs, operator interfaces, handheld instruments, and development tools for embedded control low cost single board computers, embedded controllers, and operator interfaces for scientific instruments & industrial control development tools for embedded control order our low cost I/O-rich embedded control products embedded controller manufacturer profile single board computers & embedded controllers development tools & starter kits for your embedded design operator interfaces with touchscreens and graphical user interface plug-in expansion modules for digital & analog I/O C language & Forth language integrated development tools, IDE single board and embedded computer accessories embedded controller enclosures, bezels, environmental gaskets

Table of Contents

GPS Overview

The Garmin GPS Subsystem

GPS Wildcard Hardware

Connecting To the Wildcard Bus

Selecting the Wildcard Address

Mosaic GPS Driver Software

Driver Functions Extract GPS Data from NMEA Sentences

Overview of the Mosaic GPS Software Device Driver Functions

GPS Service Loop Is Best Placed In Its Own Task

Demo Program Prints Formatted GPS Data

Installing the Mosaic GPS Wildcard Driver Software

Using the Mosaic GPS Driver Code with C

Using the Mosaic GPS Driver Code with Forth

Glossary of GPS Driver Functions

Glossary Quick Reference

GPS_STRUCT Definition

Glossary Entries

C Demonstration Program

Forth Demonstration Program

Hardware Schematics

The GPS Wildcard User Guide

<< Previous | Next>>

C Demonstration Program

This section presents the ANSI C version of the demonstration program source code.

 

// Filename: GPS_WC_Demo.c

// Date: Feb 27, 2007

// copyright 2007 Mosaic Industries, Inc. All rights reserved.

 

 

// This is a demonstration program for the GPS Wildcard.

// Make sure that GPS_MODULE_NUM matches your hardware jumper settings.

// Note: in real applications, the GPS service should be invoked from a separate task.

 

 

#define GPS_MODULE_NUM 0   // MUST match hardware jumper settings!

 

void GPS_Run ( int local_hour_offset, int module_num )

// this function initializes the GPS Wildcard and prints a formatted summary

// of GPS info to the terminal every 5 seconds.  Type any key to terminate the function.

// Note: in real applications, the GPS service should be invoked from a separate task.

{  int print_counter;

   if(GPS_Init(local_hour_offset, module_num))

      printf(“GPS_Init FAILED!\r\n”);     // we’re done if GPS_Init error flag is true

   else                          // if initialization ok, proceed...

   {  printf(“\r\nStarting GPS info dump. Type any key to exit this function.\r\n”);

      printf(“This function gets a data frame from the GPS once per second,”);

      printf(“and prints a statement telling of the fix validity.”);

      printf(“If the fix is not valid, make sure your antenna is outside,”);

      printf(“and give the GPS some time (5 minutes worst case) to acquire its satellites.”);

      printf(“This function periodically calls GPS_Info_Dump to summarize the GPS data.\r\n”);

      while(?Key==0)                // type any key to end this routine

      {  printf(“\r\n\r\nValid fix?: “);

         if(GPS_Update(module_num) // runs every second

            printf(“NO”);           // if GPS_Update returned true error flag: no fix

         else

            printf(“YES”);          // if no GPS_Update error: yes, we have a fix

         if(print_counter++ == 5)      // detailed print every 5 seconds

         {  print_counter = 0;         // restart counter

            GPS_Info_Dump(); // print formatted extracted gps info

         }

      }

   }

}

 

 

void GPS_Demo ( void )

// this function initializes the GPS Wildcard with a specified time zone and module number,

// and prints a formatted summary of GPS info to the terminal every 5 seconds.

// Type any key to terminate the function.

// Note: in real applications, the GPS service should be invoked from a separate task.

{  GPS_Run(GPS_PACIFIC_TIME, GPS_MODULE_NUM);

}

 

void main(void)

{  GPS_Demo();

}

 

<< Previous | Next>>


Home|Site Map|Products|Manuals|Resources|Order|About Us
Copyright (c) 2006 Mosaic Industries, Inc.
Your source for single board computers, embedded controllers, and operator interfaces for instruments and automation