Interfacing Equipment using NMEA 0183 Log Out | Topics | Search
Moderators | Register | Edit Profile

Electric Marine Discussions » Boats (in general) » Interfacing Equipment using NMEA 0183 « Previous Next »

  Thread Last Poster Posts Pages Last Post
  Start New Thread        

Author Message
 

Ted Lavino
Moderator
Username: tlavino

Post Number: 143
Registered: 01-2006
Posted on Sunday, July 25, 2010 - 09:02 am:   Edit Post Print Post

Folks a treatment of NMEA 0183 and RS232 vs. RS422 from Nolan Engineering, the makers of very capable NMEA Multiplexors and Repeaters. It can get a bit technical at times, but worth getting through...

Interfaces; RS-232, RS-422, NMEA 0183, ...

Introduction
The NMEA 0183 Standard, along with RS-232, RS-422, etc., belongs to the class of "Asynchronous Serial" interfaces. This means that data is transmitted serially (bit-by-bit) on a single line. Furthermore, the transmission is asynchronous because no "clock" signal is transmitted with the data.

When using asynhcronous communications, "TIMING IS EVERYTHING". In order to synchronize to the incoming data, a receiver needs to know the bit rate (baud) of the incoming data and the number of Start, Stop, and Data bits. Without this information ahead of time, the receiver (usually a UART) has no chance of correctly deciphering the Serial bit stream. The receiver will "resynch" on each new byte of data when it receives the "Start" bit. This allows for timing errors of a few percent to be tolerated. The tradeoff is that nearly 40% of the channel bandwidth is used for overhead (synchronization).

What distinguishes NMEA 0183, RS-232, and RS-422 from each other is their physical voltage and current interface levels. NMEA 0183 originally allowed "single-ended" drive, but was later updated to differential drive (RS-422). RS-232 is a bipolar interface and RS-422 is differential drive. These are explained in more detail next.

RS-232
The RS-232 has been around since the very early days of Digital Communications. Early implementations required elaborate hardware "handshaking" to maintain communication. Twenty-five pin connectors with several handshaking and "flow-control" lines were needed in most installations. Later, with the advent of microprocessors, hardware handshaking dissappeared in favor of software flow control. Nowadays, most RS-232 interfaces use only a "transmit Data" (TD) wire, a "receive data" (RD) wire, and "ground" (GND). For one-way transmission (or reception), only two wires are needed.

An RS-232 line will go to a negative or positive voltage with respect to Ground, depending on whether a binary "one" or "zero" is transmitted. Any voltage greater than +3.0 is considered a "zero" (space), whereas any voltage less than -3.0 is taken as a "one" (mark). The range between +3.0 and -3.0 volts is undefined. These voltages worked fine in early communication systems, but they do not interface easily with modern digital electronics which operate in the 0-5 volt range.

The RS-232 interface is intended for use in high-impedance circuits. This means that the drivers are not expected to provide large drive currents. Receivers will usually have impedances in excess of several k-ohms. RS-232 interfaces are somewhat sensitive to environmental noise (motors, ignition pulses, etc.) and are therefore usually limited to installations of tens of feet or less.

RS-422
RS-422 is most commonly called "differential drive". Two wires, A and B are used for this interface, but neither wire is grounded. A "zero" is produced by making A positive with respect to B and a "one" by making B positive with respect to A. It is therefore the direction of current flow rather than a voltage level that determines the logic state. It is important to note that neither RS-422 signal line (A and B) can be connected to Ground.

RS-422 is a low impedance interface and can often drive loads down to tens of ohms. It is very immune to external noise, and so can be used over greater distances (hundreds of feet). Under the latest version of NMEA 0183, all talkers are supposed to be RS-422. RS-422 is not strictly compatible with RS-232, but most RS-422 drivers will act like a single-ended driver if only one output line is used. In this way, the RS-422 "A" output can be used to drive either an RS-232 input directly. The "B" line is simply left unconnected.

NMEA 0183
Early versions of the NMEA 0183 Standard specified that "listeners" must be isolated from ship's ground but allowed "talkers" to be simple single-ended drivers (referenced to ground). Furthermore, the input impedance of a listener was specified to be greater than 500 ohms, and opto-isolation was recommended. Later versions of the Standard retained the opto-isolated listener recommendation, but revised the talker requirement to be RS-422 compliant. As a result, there exist some instruments (talkers) with single-ended outputs and others with RS-422 (differential) outputs. Fortuneately, both types of outputs will drive opto-isolated listeners.

Single-ended drivers are perhaps the simplest to design. The desired state indicated by the presence or absence of a voltage above some threshold. For NMEA 0183 (ver. 1.5), a "one" was any voltage less than +0.5, while a 'zero' was any voltage greater than +4.0. Besides their design simplicity, single ended drivers need only one wire to transmit data. Since voltages are referenced to Ground, no signal return line is needed.

The conversion of NMEA 0183 talkers to RS-422 (ver. 2.0) was a good move, although it increased the confusion factor among installers and required the use of "two-wire" connections. RS-422 has excellent noise immunity even in long cable runs and has ample drive capacity. A single RS-422 talker can easily drive 4 or more opto-isolated listeners.

On the listener side, most manufacturers seemed to have adopted the NMEA "opto-isolation" recommendation. Opto-isolators are actually quite simple devices. They consist of a light source (LED) coupled to a phototransistor. The input data signal turns the LED on and off which causes the phototransistor to switch on and off. The LED and phototransistor are completely isolated from each other electrically. The data source (talker) must provide sufficient current and voltage to power the LED. A current limiting resistor in series with the LED is generally used for protection. The advantage of opto-isolated inputs is that virtually any type of driver can activate them.

Interface Compatibility
The question of interface compatibility often comes up in NMEA 0183 installations. Here is a summary of what to expect:

* Almost any type of driver (TTL, RS-232, RS-422, etc.) will drive at least one opto-isolated NMEA 0183 listener. RS-232 drivers will usually drive two listeners while RS-422 will often drive more than four listeners.
* RS-232 listeners (i.e., computers) can only be reliably driven by RS-232 drivers because of the negative voltage in the "idle" state. In practice, however, many RS-232 receivers will interpret a O-volt input as an "idle" (logic 1) state and thereby correctly interpret data from single-ended drivers such as TTL or older NMEA 0183 talkers. This is why some GPS units have been successfully connected directly to a PC serial input without any signal conversion.
* RS-232 listeners can also usually be driven by RS-422 drivers connected in "single-ended' mode. This is done by connecting the 'A' output to the RS-232 input and leaving the 'B' output disconnected.

The bottom line on interfacing is that most interface types are interconnectable once you know what you have.
 

Ted Lavino
Moderator
Username: tlavino

Post Number: 45
Registered: 01-2006
Posted on Wednesday, April 11, 2007 - 10:20 pm:   Edit Post Print Post

After being pressed, Garmin owned up to modifying their position regarding the compatibility of their handheld GPS units with NMEA 0183, which I expect is similar to what most manufacturers are doing in that space.

In this particular case the GPSMAP 76 unit purports to be NMEA 0183 version 2.3 compatible. However, their wiring schematic for their interface describes an EIA-232 configuration (formerly called RS-232), which is specifically not supported in versions 2.0 and later.

In a recent email exchange they had the following to say:

"Our physical implementation is noncompliant to the NMEA 0183 spec. This is undeniably true. It is also undeniably true that our implementation of the NMEA 0183 data format is fully compliant to the NMEA 0183 spec.

This is common practice in the industry to send data whose format is compliant to the NMEA 0183 spec over an RS-232 electrical interface or even a TTL level asynchronous serial interface whose polarity is compatible with that of RS-232."

So the bottom line is that ASCII text in the form of NEMA compatible sentences are coming out of an EIA-232 port of most hand held GPS units, which is likely done as David mentions to be compatible with the serial port standard formerly used by Intel x86 computers. The Macintosh platform however did formerly use EIA-422 serial ports. Both platforms now use Universal Serial Bus (USB) serial ports.

This may sound like nit-picking, but by not being aware of how equipment adheres to standards and therefore the protocols expected by other equipment when connecting the two can lead to a plethora of nagging incompatibilities.
 

Ted Lavino
Moderator
Username: tlavino

Post Number: 16
Registered: 01-2006
Posted on Tuesday, January 23, 2007 - 11:23 am:   Edit Post Print Post

David, I came across a discussion on the SSCA web site that discusses chart plotter options for Macintosh users. One of the posters talks of using BlueTooth to facilitate NMEA connectivity with various devices rather than have a slew of RS-232 serial ports hanging off the computer. Have you run across anyone else doing this?

"...
2 - One thing I do that would work as well with most Win machines - blue tooth. The only peripherals I connect with USB are my SSB and Pactor. All my Nav instruments are connected through a NMEA Blue Tooth multiplexor, and all that data is routed to/from my laptop wireless. Works great and frees my laptop from the Nav station unless I need to connect to the radio. I can monitor my Nav instruments (including radar and AIS - both integrate with MacENC) from anywhere on the boat, or even from the dock. My small printer is also bluetooth.

..."

The original thread is at http://64.70.221.24/DiscBoard/viewtopic.php?t=1302
 

Ted Lavino
Senior Member
Username: Tlavino

Post Number: 423
Registered: 01-2004
Posted on Monday, May 15, 2006 - 10:51 am:   Edit Post Print Post

Thanks David for the excellent detail. I was thinking of how to put together a system that included both GPS and Chartplotter talkers and was reading information on NMEA multiplexors on Noland Engineering's website (www.nolandengineering.com) that combines up to 4 talkers on one serial bus. Bandwidth issues aside for the moment, I've heard very positive feedback regarding their products, which expect NMEA 0183 standard communications (i.e. RS-422 according to Noland). They do however have a fifth interface in the form of a DB-9 connector that uses RS-232 for integration with a computer, getting around the whole question of RS-232 vs. RS-422.

As an alternative I understand Nobeltec's VNS can be configured to forward specific sentences coming in on one RS-232 serial interface out a second RS-232 serial interface, but I thought that solution less than optimum.
 

David Sheriff
Board Administrator
Username: Admin

Post Number: 56
Registered: 01-2004
Posted on Monday, May 15, 2006 - 10:17 am:   Edit Post Print Post

If the "listener" device maker followed the hint in the standard, I expect the combination would work just fine. There are no absolute guarantees based on specifications, but an autopilot that will not understand what a PC is telling it will have trouble in the marketplace.

If in doubt, confirm with the device maker you want your computer to talk to.

There is one potential complication. You can only have one "talker" on each circuit. Assume the GPS is the talker and the computer is the listener. Then the computer can be the talker on another connection with the autopilot as the listener. Note that this requires splitting the RS-232 transmit and receive signals at the computer, which may take a special cable. Also, the autopilot cannot talk to the computer.

The autopilot expects heading information and cross track error, both of which you get from the computer charting program. Heading information is used when changing from one-way point to another. The autopilot then modifies the course actually steered to minimize the cross track error to the next waypoint regardless of what heading it actually follows.

The autopilot actually steers from moment to moment using a magnetic or a rate compass. The rate compass uses laser ring gyros to stabilize the reading of a fluxgate compass. As the boat pitches and rolls, the reading from the fluxgate compass bounces around quite a bit. This is partially due to the fact that the Earth's magnetic field has a vertical as well as horizontal component. All we are interested in is the horizontal component, but the fluxgate response to both. This problem increases the closer you get to the Earth's poles.

When an autopilot is integrated into a commercial chart plotter system it provides instantaneous compass data to the chart plotter. The chart plotter usually ignores this data but can display it for the operator.

With the RS-232 GPS-computer-autopilot setup we outlined above, there is no way to get compass data from the autopilot to the computer. It might be possible to connect the GPS to the autopilot and to connect the autopilot to the computer. This would work if the autopilot retransmits GPS data to the computer.

If you're going to put together a system like this, you'd better seek assurances from the autopilot manufacturer that it will work this way.

The way large integrated manufacturers like Raymarine and Furuno solve this problem is to communicate between their various devices on a proprietary, low-speed bidirectional buss. As a practical matter, NMEA 183 is mostly used to communicate between systems from different manufacturers.

NMEA 183 version 3.01 defines nearly a hundred current sentences plus 70 some odd obsolete sentences no longer recommended for new designs. The same information may be transmitted in a number of different sentences combined with various other information. Only a few sentences are in common use today.
 

Ted Lavino
Senior Member
Username: Tlavino

Post Number: 422
Registered: 01-2004
Posted on Sunday, May 14, 2006 - 11:19 pm:   Edit Post Print Post

Actually, one other question. I understand the issue with having to integrate RS-232 listeners into the equation due to the plethora of laptops using chartplotting software. What would be the ramifications of an RS-232 device being the talker, i.e. controlling the autopilot that is theoretically expecting to communicate with an RS-422 device?
 

Ted Lavino
Senior Member
Username: Tlavino

Post Number: 421
Registered: 01-2004
Posted on Sunday, May 14, 2006 - 11:15 pm:   Edit Post Print Post

Thanks David, very illuminating. According to Garmin the interface used on the their GPS receivers/chartplotterw is RS-232. The interesting question is how well their hardware would interoperate with NMEA 0183 devices that expect RS-422, such as say the NMEA 0183 RS422 multiplexor made by NoLand or an NMEA 0183 compatible autopilot?
 

David Sheriff
Board Administrator
Username: Admin

Post Number: 55
Registered: 01-2004
Posted on Sunday, May 14, 2006 - 07:51 pm:   Edit Post Print Post

NMEA 183 specifies an electrical interface and a list of "commands," called sentences. Some aspects of the electrical interface are the same as EIA422, although the two are not the same.

The serial port on a computer should meet the EIA232 standard, which involves a number of control lines as well as a serial interface. Both 232 and 422 define a bipolar electrical interface. EIA-232 is often implemented in computers without the negative polarity drive because its less expensive. The software usually ignores the control lines so we are left with something that looks a little like the positive side of EIA422.

Version 3.01 of NMEA 183 has a sentence that I believe explains why, as a practical matter, a PC can talk to NMEA 183 devices. "For reasons of compatibility with equipment designed to earlier versions of this standard it is noted that the "idle, marking, logical "1" OFF or stop bit state" had previously been defined to be in the range of -15 to +0.5 volts. The "active, spacing, logical "0", ON or start bit state was defined to be in the range of +4.0 to +15 volts while sourcing not less than 15 mA." An interface like this would detect an EIA422 or an EIA232 signal or the positive half of either while only sacrificing some noise immunity.

This is essentially a hint within the standard which suggests that some of the gray, undefined voltage range in the EIA422 standard can (wink, wink) be treated in such a way that older devices work. Doing so happens to coincide with the bastardized way PCs usually implement EIA232.

There is an even easier reason why a PC can "communicate" with a GPS. All it needs to do is listen. Most GPS recievers continually disgorge a sentence containing everything you might want to know once every second. The voltage swing in RS422, if the GPS bothers to actually implement that parameter, is much wider than what the PC is looking for. So the PC can easily listen to the information even though neither the PC nor the GPS actually meets its full interface specification.

This state of affairs seems sloppy until you realize that a GPS that cannot talk to a PC is useless to a lot of people. So they better make it work no matter what the specifications say. And it works well enough that no one complains it might not actually meet the letter of the standard.
 

Ted Lavino
Senior Member
Username: Tlavino

Post Number: 420
Registered: 01-2004
Posted on Friday, May 12, 2006 - 11:42 pm:   Edit Post Print Post

John, I've been told by several vendors that NMEA 0183 covers both the list of commands as well as the electrical interface to be used. Not having paid the $300 required to purchase the standard from the NMEA, I would be the first to acknowledge that I haven't seen the actual wording.

From Noland Engineering, a maker of NMEA 0183 multiplextors (http://www.nolandengineering.com/nmea.php):

NMEA-0183 is a standard for interfacing marine electronic devices. This standard defines the electrical signal requirements, data transmission protocol, data transmission timing, and specific message formats for a 4800 baud serial data interface.

NMEA 0183 devices employ an asynchronous serial interface with the following parameters:

Baud Rate 4800
Data Bits 8(d7=0)
Parity None
Stop Bits One(or more)

Devices are designated as either talkers or listeners with some devices being both. A talker is any device which sends data to other NMEA 0183 devices. A listener is any device which receives data from other NMEA 0183 devices. Instruments which are both talker and listener will have separate connections for each function. All data either transmitted or received is interpreted as 8 bit ASCII (d7=0).

Electrical Requirements

Talker:
Under the latest version of the standard, NMEA 0183 talkers are supposed to be differential drive compatible with EIA RS-422. Differential drive signals have no reference to Ground and are more immune to noise. Earlier versions of the NMEA 0183 standard allowed single-ended drive circuitry for talker(s) (i.e., 0 to +15VDC). Therefore, there are still instruments around which are not differential drive output. A single talker can drive multiple listeners within drive current limitations.

Listener:
NMEA 0183 listeners are supposed to have input isolation from the ships Ground. Opto-isolation, which is generally used to meet this requirement, limits the input impedance. The standard specifies a minimum input resistance for listeners of 500 ohms and most devices will probably be close to this value.
 

John Fellner
Advanced Member
Username: John_fellner

Post Number: 22
Registered: 07-2004
Posted on Friday, May 12, 2006 - 04:20 pm:   Edit Post Print Post

Ted,
NMEA standard is a software protocol similar to a computer programming language except it has been designed for GPS receivers. RS-232 or 422 are transmitting standards used to send and receive data through cable. NMEA standard only applies to the commands used by software engineers. These commands can be transmitted in any format the equipment manufacture wants to use, like RS-232 or 422. RS-232 was developed in 1964 and is still widely used over short distances, like between a PC and a printer. RS-422 is more complicated but works over longer distances, up to 4000 ft. To answer your question, I think you will find chart plotters and other equipment you want to interface with your GPS will use RS-232 and you won’t have a compatibility problem.
John Fellner
 

Ted Lavino
Senior Member
Username: Tlavino

Post Number: 419
Registered: 01-2004
Posted on Friday, May 12, 2006 - 01:18 pm:   Edit Post Print Post

David, I've been having an ongoing discussion with the folks at Garmin, and thought you might have some input. Basically the discussion is regarding the correct type of interface NMEA's 0183 standard version 2.0 and above calls for.

My information is that NMEA 0183 version 2.0 and above calls for an EIA RS-422 interface only that uses differential voltage (+5v/-5v) and the NMEA recommends using an optical isolator on all listeners. EIA RS-232 interfaces are specifically not supported by NMEA 0183 2.0 and later.

Garmin's GPSMAP 76 for example is advertised by its manufacturer to be compatible with NMEA 0183 version 2.3, yet uses an EIA RS-232 single ended interface (ground/up to 15v). So, the question is is their claim of NMEA 0183 2.3 compatibility correct, and if not, what are the practical ramifications? I understand that personal computer serial interfaces in the past have been built using the EIA RS-232 standard and therefore will work correctly with the Garmin interface if so connected, but what about other NMEA 0183 listeners such as chart plotters, etc. that are using RS-422 interfaces instead?

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration