Thursday, January 29, 2009

GPS Receivers Protocols


A protocol is a way for two devices to successfully talk with each other. Think of a protocol as a language with a strict set of rules. When one device sends a message to another device, it expects a certain type of response back. This structured, back-and-forth conversation takes place until one device sends a message that says the conversation is over.
Likewise, when you connect a GPS receiver to a computer, a certain protocol is used to transfer data back and forth between the two devices. You need to ensure that the same protocol has been selected for both devices. If two different protocols are used, it’s like the GPS receiver speaking Russian to a computer that understands only Chinese.
The protocols typically used with GPS receivers are
  • NMEA: The National Marine Electronics Association came up with the NMEA 0183 standard, which is a protocol for transferring data between marine-related electronics such as GPS receivers, autopilots, and chart plotters. Virtually all GPS receivers support the NMEA 0183 standard, which uses widely documented text messages. Typical NMEA data includes latitude, longitude, time, and satellite status. NMEA comes in several different versions, including 1.5, 2.1, and 2.3. Make sure that this version number matches both the GPS receiver and the computer program that you’re using.
  • Proprietary: Some GPS manufacturers have their own proprietary protocols for communicating with a GPS receiver. These protocols send additional data that isn’t included in the NMEA standard: for example, altitude, speed, and position error.
NMEA is the de facto standard for getting a GPS receiver to talk to a computer. However, some programs support GPS manufacturer proprietary protocols. If you have a choice between NMEA and a proprietary protocol (for example, the Garmin protocol used with Garmin GPS receivers), select the proprietary protocol because it can supply richer data to a program.

USB ports and GPS Receivers

Consumer GPS receivers first started appearing in the mid-1990s. At that time, personal computers exclusively used serial ports to interface with other devices, making it easy for hardware manufacturers to design their products to communicate through a serial port. GPS was initially popular with sailors because they could connect a GPS receiver to an autopilot or chart plotter and navigate a vessel based on GPS data. With the right cable, you can also connect your GPS receiver to a computer and download and upload data.
Serial ports are now going the way of the dinosaur, replaced by easier-touse and faster USB ports. In fact, some laptops no longer have serial ports. However, GPS manufacturers have been slow to jump on the USB bandwagon and until recently have relied on serial port connections for getting GPS receivers and computers to talk to each other.
At some point, GPS receivers with USB connectivity will eventually become widely available in the marketplace. But until that time comes (and considering the millions of GPS receivers already manufactured that can connect only through a serial port), what do you do if your computer doesn’t have a serial port?
The solution is to use a USB serial port adapter. The adapter plugs into your computer’s USB port and has a standard 9-pin connector that you can connect your serial port devices to. After you install a driver for the adapter (which comes with the product on a disk or CD), Windows recognizes the adapter as a serial port. Just connect a PC interface cable to your GPS receiver and the adapter, and you’re all set to send and receive data between the two devices.
Note this one little “gotcha” to mention regarding USB adapters: Windows might squawk that you need a driver when you plug in the adaptor, but you know you’ve already installed one. The fix: In the dialog box that’s prompting you for the driver location, tell Windows to look in the C:\Windows\Drivers directory. (This path is for Windows XP; the location varies in older versions of Windows: for example, C:\WINNT\system32\drivers in Windows 2000.) Depending on what USB devices are running at the time, Windows XP might assign the adapter to a different COM port from the last time it was used and incorrectly assume it’s a new device that needs a new driver. This abovementioned directory is where previously installed drivers are stored, saving you from having to find the original driver distribution disk. All GPS receiver manufacturers sell their own branded serial-to-USB adapters, albeit at a premium price. If you’re on a tight budget, most any third-party adapter that you buy from a computer retailer will work. These adapters tend to be cheaper than the GPS manufacturer brand-name models.

Wednesday, January 14, 2009

Typical COM port setting


Unless the program specifies otherwise, here are the typical COM port settings to use when interfacing with a GPS receiver:
  • Baud rate: 4,800 and 9,600 baud are almost certainly guaranteed to work with all GPS receivers. You can increase the speed to a higher rate on some types of GPS receivers. The higher the speed, the faster the data transfer. I recommend experimenting until you find the fastest, mostreliable baud rate, and then using that setting.
  • Data bits: 8.
  • Parity: None.
  • Stop bits: 1.
  • Flow control: None.
Some GPS receivers allow you to set the baud rate in the system setup page of the receiver, but other models don’t give you any control of the speed. Check your GPS receiver user guide for more information about your model.

COM ports Properties

COM ports have properties that establish how the communication between the two devices will occur. Generally, both of the devices need to have the same settings. The COM port properties include
  • Baud rate: Baud is the speed at which the port communicates with other devices. This number is in bits per second (bps): the bigger the number, the faster the speed.
  • Data bits: This is the number of data bits that are transferred for each character, typically 7 or 8.
  • Parity: This is a form of error checking that ensures the integrity of transferred data.
  • Stop bits: This is how many bits follow a character and mark the end of a data transmission.
  • Flow control: Sometimes called handshaking, this is a way for one device to stop another device from sending data until it’s ready to receive the data.
Although you can set COM properties in Device Manager, I recommend making changes in the program that you’re using to interface with the GPS receiver. You’ll usually see an Options or Configuration menu in the program that displays a dialog box where you can set these values.

COM ports for GPS Mapping

A COM port is a computer serial port that’s used to connect a mouse, modem, or other device, like a GPS receiver. (COM stands for communication, and the ports are called serial ports because they receive data serially, one character at a time.) COM ports typically have a small oval, D-shaped connector (with nine pins) and are located on the back of your computer. (If you have other devices plugged into your serial ports, you’ll need to unplug them so your GPS receiver cable has a port to plug in to. You can plug the other devices back in when you’re through transferring data with your GPS receiver.) Your PC might have one or two physical serial ports that you can plug devices into, but Windows allows you to assign a COM port number to each device. These numbers usually range from 1 to 4 but might go as high as 256 if a USB adapter is used, (which I talk about in the upcoming section, “USB ports”). In most cases, you won’t need to use Windows to reassign any of the port numbers. Just know that you have numbered COM ports and that you need to assign one to your GPS receiver, which I talk about next. To get more detailed information about COM ports and Windows, including how to change settings with Windows Device Manager, head to the Microsoft support Web site at http://support.microsoft.com and search the Knowledge Base for com port. Or pick up a copy of PCs For Dummies, 9th Edition (Wiley) by Dan Gookin, which has an excellent chapter that clearly explains everything you need to know about the subject. The program you’re using to interface with the GPS receiver is where you need to specify which COM port number the receiver is connected to. Programs typically use a drop-down list box that shows all the COM ports; just select one from there. (Some programs have an autoselect feature that tries to establish communications on all available COM ports until the port with the GPS receiver is found.)

Understanding Ports and Protocols


Argg. You track down the right cable you need. You plug one end into your GPS receiver and the other into your computer. And nothing happens. Exactly. Nothing should happen because you need to be running some type of software on your computer that enables the two devices to talk to each other. Before I discuss interface software, however, I have to lay some groundwork. The programs designed to communicate with GPS receivers have one thing in common: You need to specify certain communication parameters in both the program and the GPS receiver for the devices to successfully exchange data. If the settings aren’t correct, you may as well try to communicate with someone a thousand miles away by sending smoke signals through a telephone line. Although setting the right communications parameters isn’t that difficult, it can be a bit confusing. This section guides you through the process and also gives you some tips on smoothing out some common problems that you may encounter, beginning with ports and their settings. Setting up communications between a GPS receiver and a PC is a one-time process. After you get everything working, no worries about the next time.

Untangling GPS Receiver Cables

If your GPS receiver uses a cable to connect to a computer and you want to interface the two, you need the right type of cable. Some GPS receivers come bundled with this cable; others don’t.
If you don’t have a cable for your GPS receiver, get one. Cables tend to vary in design between manufacturers and models, so be sure to get the right one for your GPS receiver. (See Figure for examples of different types of cables.) You can purchase a cable directly from the manufacturer at its Web site or through a retailer. Expect cable prices to range from $20–$45. For this connectivity, you need a PC interface cable. It has a connector that attaches to the GPS receiver on one end and an RS-232, 9-pin serial connector on the other end to connect to your computer.
Newer GPS receiver models support USB. If your GPS receiver supports both serial and USB interfaces, use a USB cable for much faster communications. If you bought a GPS receiver that didn’t come with a cable and you can’t find a cable to buy, you’re not necessarily completely out of luck. If you’re handy with a soldering iron, most GPS receiver manufacturer Web sites describe the pinout configurations of their cables so you can make your own. The tricky part can sometimes be finding the right connector for the GPS receiver because most connectors vary between manufacturers and models. A number of how-to sites on the Internet show you how to build your own cables and where to get the connectors. Do a Web search for gps cable connector and the brand of your GPS receiver to find different options.
Some cables are designed to both power a GPS receiver from a cigarette lighter and to connect to a computer to send and receive data. These cables are especially useful if you’re using your GPS receiver with a moving map program and a laptop. Just remember that you’ll also need to buy a dual, car cigarette-lighter adapter so you can plug in both your GPS receiver and laptop into a single cigarette lighter.
If you have a Garmin receiver, check out the Pfranc company for its quality Garmin-compatible cables. Larry Berg started out making shareware Garmin cable plugs, and his business grew. He now stocks a line of reasonably priced cables for all Garmin models. Check out his Web site at www.pfranc.com.