MacGPS 45

Garmin GPS 40/45 Communications for the Rest of Us

Development Version 0.1

September 16, 1994

A modified version of this program is packaged with the GPS flight verification system. The new version is called Macgps

"I wrote this program so that I could quickly save and restore waypoints and routes, and capture track logs, using my Macintosh computer with a Garmin GPS 45. Although not complete, I think that it could be a useful tool for others to do the same with their GPS 40/45 receivers. I have tested the program with a GPS 45, and I believe that the 40 and 45 use the same protocol, but have not been able to test for this compatibility. I don't know if the protocol of other Garmin receivers is compatible with that of the GPS 45." John Waers

Hardware Interface

This is the hardest part of getting your Macintosh to talk to the GPS receiver. You may need to enlist the aid of the neighborhood nerd to accomplish the wiring task.

The GPS receiver must be connected to the Macintosh modem port. Garmin sells a power/data cable (P/N 4520, $30 list) which may be wired to a Macintosh mini-DIN connector. Connect the wires as follows (see Inside Macintosh, Volume IV, page 248 for Macintosh connector details):

 

GPS 45 Macintosh

Data Out (Brown) Receive Data - (5)

Data In (White) Transmit Data - (3)

Ground (Black) Ground (4)

The GPS 45 data out is a 0 to 5 volt signal which will drive an RS-232 port (RS-232 transition levels are typically about 1 to 2 volts). The Macintosh will not respond to this signal if the Receive Data + (8) line is grounded. I've had good results leaving the Macintosh Receive Data + open, but this may not work with all computers. It may be necessary to bias the Receive Data + line at some positive voltage. If anyone has any problems with this, let me know and I will try to work up some sort of scheme that will work.

While you're at it, you can also connect a DC power supply (5 to 40 volts DC) between the Garmin Power (red) wire and the Ground (black) wire, and save your batteries. Radio Shack has quite a selection of AC adapters which will work. I am using a 12 volt, 500 mA AC adapter (Radio Shack P/N 273-1652B), but any adapter rated at 6 volts or more with an output current of 250 mA or more should work.

Program Features

Upload and download waypoints, routes, track logs and satellite almanac data. All but the almanac data are saved in a editable, tab-delimited text files, allowing easy entry of waypoints and routes using a text editor. The waypoint, route and track log files may be easily imported into a graphing/analysis program, such as Igor, for graphical display.

User selectable map datum, allowing coordinate conversions to the same set of 102 map datums within the GPS 45.

User selectable output file position format, with latitude and longitude in degree/minute/second, degree/decimal minute, or decimal degree format, or UTM grid coordinates. Latitude and longitude values are shown as negative values for southern latitudes and for east longitudes.

Limited NMEA 0183 data capture utility. This function works with the application in the foreground, but the program needs more work to capture data in the background.

Apple Menu/About MacGPS 45

The buttons in this dialog may be reminiscent of an ancient operating system, rumored to be still in use. These buttons actually operate in much the same manner as similar commands did in that operating system.

File Menu/Preferences

Selecting the Preferences menu brings up the following dialog box:

 

Selected Datum

Select the desired map datum from the list. The following information is displayed for the selected map datum:
a = semi-major axis of reference ellipsoid, meters
f = ellipsoid flattening
x,y,z = offsets from the WGS84 ellipsoid centre, meters

The selected datum affects the position data in the waypoint, route and track log files; the NMEA data is referred to the map datum selected in the GPS 45.

Output File Position Format

Select one of the four available file formats for position data. These buttons determine the format of the data stored in the waypoint, route, track log and NMEA files. The degree/minute/second and the degree/decimal format contain the punctuation as shown, and thus probably cannot be imported into other programs. The UTM format does coordinate conversions for the northern hemisphere only, up to 84∞ North latitude. UPS conversions for the polar regions are not yet supported by the program, and the program does not yet correct for the false northing added in the southern hemisphere.

Data File Creator

The output data file has a type of 'TEXT', but the creator is user selectable. Some common creators are 'ttxt' for TeachText, 'QED1' for QUED/M, 'R*ch' for BBEdit, etc.

UTC Offset

Enter the difference between your local time and UTC, or set this value to zero if you want to use UTC time stamps in the data files. This offset corrects the UTC time to local time for time stamps in the waypoint, route, track log and NMEA files.

Communications Menu/Download to GPS 40/45
Almanac
Routes
Track Log
Waypoints

Communications Menu/Upload from GPS 40/45
Almanac
Routes
Track Log
Waypoints

Select one of these hierarchical menu items to transfer data from a file to the GPS 45, or to transfer data from the GPS 45 to a file. When any of these hierarchical menus is selected, the program reminds you to set the GPS 45 to the correct protocol:

 

Almanac

The almanac data is presently stored as ASCII hexadecimal characters representing the data stream actually sent to/from the GPS 45. I have yet to figure out the GPS 45 almanac format. This is presently not too useful to anyone with the possible exception of GPS 45 hackers.

Route

Each route is identified by route number and name, followed by the waypoints comprising that route. When downloading route information to the receiver, new waypoints are created as necessary, and existing waypoints are overwritten if the new waypoint has the same name.

Track

Each of those points in the map display is a time stamped position. When downloading a track log to the GPS 45, the receiver ignores the time stamps.

Waypoint

Each waypoint includes the name, position, description and time stamp indicating the waypoint entry time.

NMEA 0183 v2.0Ö

Select this item to capture real-time position data from the GPS 45 to a file. When this item is selected, the program reminds you to set the GPS 45 to the correct protocol:

 

File Formats

Each almanac, waypoint, route and track log file starts with the following header line, which contains three fields which are used by the program when downloading the file information to the GPS 45. The format field ("DDD") may be either "DMS", "DMM", "DDD", or "UTM", depending upon the format of the file position data. The UTC time offset ("-6.00") is used to correct file time stamps to UTC, and the datum number ("061") is used to correct file coordinates to WGS84 coordinates for transferring data to the GPS receiver. When editing the file, this line should not be altered.

Format: DDD UTC Offset: -6.00 hrs Datum[061]: NAD27 CONUS

The route file contains both route and waypoint records. The route record starts with the letter 'R', followed by the route number and the route name. Each field is separated by a tab (indicated by the '_' letter below). If the route has not been explicitly named (ie., the route name is the default "START TO END" waypoint route name), the name is stored as 16 underscore characters.

R_1_________________

The track log file contains track records in the following format, with the '_' character designating a tab character. Each track record starts with the letter 'T'. This example shows each of the four position formats that may be selected in the Preferences menu. Note that the UTM zone number and letter are separated by a tab, as are the other fields. The date and time in the time stamp field are separated by a space.

T_09/09/1994 20:03:49_40.1780207_-105.0901666

T_09/09/1994 20:03:49_40∞10.681'_-105∞05.410'

T_09/09/1994 20:03:49_40∞10'40.9"_-105∞05'24.6"

T_09/09/1994 20:03:49_13_T_0492323_4447310

The waypoint file contains waypoint records in the following format, with the '_' character designating a tab character. Each waypoint record starts with the letter 'W'. This example shows each of the four position formats that may be selected in the Preferences menu. Note that the UTM zone number and letter are separated by a tab, as well as the other fields. The date and time in the time stamp field are separated by a space. The name field may be up to 6 letters, the description field up to 16. All letters must be upper case.

W_HOME_123 SNOWMASS PL_07/28/1994 20:12:54_40.1777471_-105.0892654

W_HOME_123 SNOWMASS PL_07/28/1994 20:12:54_40∞10.665'_-105∞05.356'

W_HOME_123 SNOWMASS PL_07/28/1994 20:12:54_40∞10'39.9"_-105∞05'21.4"

W_HOME_123 SNOWMASS PL_07/28/1994 20:12:54_13_T_0492400_4447279

The almanac file includes 32 records, each with 42 bytes represented in ASCII hexadecimal format, containing the satellite almanac data. Check the file if you are interested in hacking the format. If anyone is successful in decoding this, let me know, and I will add a function to the program to save more useable data.

Future Directions

There is a conflict with After Dark, resulting in a system crash if the screen saver is activated when the Preferences dialog is displayed. I'll try to get it fixed soon.

Southern Hemisphere UTM coordinates. Yeah, I know, it's just simple addition. I didn't do it yet because of my lack of any near-term plans to travel to the Southern Hemisphere. Look for this in the next version.

NMEA data logging. Complete the program so that NMEA data logging can be done as a background task.

Waypoint and route editor. The routines used to read these files are not very robust, and simple mistakes in the text files can cause weird errors. I am planning to add waypoint and route editors sometime this winter.

Add UPS grid coordinates. As I am not a polar explorer, I personally don't have much need for this, but if someone needs it, let me know and I will add it.

---

I hope that you enjoy using this program as much as I have enjoyed writing it. Send any suggestions or comments to:

John Waers
123 Snowmass Place
Longmont, CO 80501
Internet: jfwaers@csn.org