Safety in Numbers?
This article was originally written in the period 1995-2000
Just when you thought it was safe to install RS 232 links with your eyes shut, along came low power lap-tops and new standards – EIA/TIA 562 & 574 – which we were all assured was compatible with 232. However, replacing a PC containing a proper RS 232 interface with a lap-top containing an ‘improper’ RS 232 interface opened up a whole new range of problems and required a re-visit to RS 232 standards and specifications. What soon became apparent was that :-
- RS 232 is STILL poorly understood, often by those that you assume, or hope, will know better
- Some 232 implementations are better than others when operating beyond the standard’s limits
- Claimed compatibility shouldn’t always be taken on trust
- Some think that “which-craft” (sic) is an essential element, as in “Which connections shall we try next?”
Problems? Hardly Surprising!
The folklore surrounding RS 232 has led to an undeserved reputation for complexity and ambiguity. Unfortunately this has not been helped by manufacturers, suppliers and ‘experts’ who quite clearly have not understood the standards. There is no such thing as ‘RS 232′ – it is merely a shorthand, and, like all shorthands, should be treated as such. There used to be an ‘EIA-RS-232-C’ (probably still the most common full reference), and a ‘-B’ before that. In 1986 it became ‘EIA-232-D’, and this is only just filtering through. The latest EIA/TIA-232-E seems almost unknown!
The 232 standard (-D/E) basically defines the electrical and mechanical characteristics required when connecting a DTE (Data Terminal Equipment – e.g. a terminal) to a DCE (Data Circuit-terminating Equipment – e.g. a modem). It also includes a description of what each pin is and does. The international equivalent standards are C.C.I.T.T. (now ITU-T) V.28 for electrical parameters, V.24 for functional definitions, plus I.S.O. 2110 for the actual pin assignments and mechanical details. It is important to note that a ‘V’-conformant modem, e.g. V.32, implicitly requires these international standards and not RS 232. Luckily, 232-D and -E are very close to the current international standards, and are generally fully compatible. Unfortunately, the pre-1986 ‘-C’ can cause problems, and yet it is still widely quoted – even though it is obsolete. The problem is compounded by the more recent EIA/TIA 562 (electrical) and 574 (physical/functional), which may be made to work with 232. (Note the phrase ‘made to work’ rather than the simplistic and misleading ‘virtually compatible’. The difference is not just one of semantics, it is one of responsibility. A supplier may claim compatibility when in fact it just means an area of overlap, but the purchaser has to make it work within such an area!)
How Far? How Fast?
The next 232 problem is one of speed and distance. The maximum speed is clearly defined as 20 kbit/s, but the widely quoted maximum distance of 50 feet, or 15 meters, is merely ‘definition by repetition’. It is just not in there, neither is there anything about pin 1 being ‘Protective Ground’ or in fact ‘anything’ Ground! Unlike some other interface standards, there is no defined trade-off between speed and distance. The maximum speed has been laid down; the maximum distance is less direct. This distance is not an absolute number, but depends upon one of the cable’s characteristics – its effective capacitance. In simple terms, the capacitance is the amount of coupling, or interaction, between each of the cable’s wires or conductors and includes any screen if present. The longer the cable, the greater the capacitance. The most important feature of capacitance is that it deforms the transition shape, or edge, of the data signal by losing part of it to other conductors within the cable. The higher the data speed the closer the transitions, and the more significant the deformation. Excessive capacitance can also damage the electronic components in the interface, which is where the vast majority of equipment failures occur. RS 232 (-D/E) and V.28 recognise capacitance as a major limiting factor in interface signals, and both have a defined maximum of 2500 pF (picoFarads) for each interface signal connection. Thus a cable of 125 pF per meter may be up to 20 meters long – assuming no capacitance elsewhere – and may be used for speeds up to 20 kbit/s. (562 is specified to operate up to 64kbit/s but is best reserved for non-industrial and very short range use only.)
Faster and Faster, Further and Further
So far, the standards are relatively straightforward to use. Only consider products with conforming RS 232 interfaces, connect them with cable of the correct characteristics, understand the effects of using any cable screen, and don’t exceed the speed limit! However, many applications are capable of speeds higher than 20 kbit/s and may need to run over distances greater than the 2500 pF capacitive equivalent. Of course, the interface doesn’t suddenly stop working when pushed beyond the defined limits, but interfaces which only just conform to RS 232 can give trouble even when within the defined limits so there is little point in pushing these any further or faster. If they truly conform to another standard which can overlap RS 232, such as EIA/TIA 562 or RS 423/V.10, then proceed with caution within the overlap area and assume the more pessimistic limit. Of course, there is no guarantee that even genuine RS 232 interfaces will work beyond the standards, but some implementations can and do. The following guidelines should help.
- Find out what the interfaces to be interconnected are really supposed to be. If possible, get data sheets or handbooks to confirm this. Remember that RS 232 requires a 25-way ‘D’ connector with the socket (female contacts) associated with the DCE.
- Although defined within RS 232, check whether each interface plug or socket is configured as a DTE or a DCE. Pin 2 is an output ( +5 volts or more, or -5 volts or less ) for a DTE, while pin 3 is an output for a DCE. Note that all voltage measurements are with reference to pin 7 – the signal ground
- Check and note the electrical characteristics of every pin to determine what it is, i.e. input, output, not connected or something odd! Fig 1 shows the designation for each pin. If there are problems here, then attempts to increase speed or distance are not recommended and further checks are advised.
- See if pin 1 is connected to anything else – specifically pin 7 or mains earth. In general, it should NOT be connected to either, although it may be possible to connect pin 7 to mains earth via a wire strap, a 100 ohm resistor or a capacitor in certain cases. Where pins 1 and 7 are joined, be prepared for the possibility of trouble!
Now you are ready to connect the interfaces together. For test purposes, use a short cable (no more than 3 meters) The most important connection is that of Signal Ground – pin 7 – between interfaces. Don’t connect outputs together – even if they appear to be at the same voltage. Try not to load an output with more than 2 inputs unless you insert the appropriate series resistors. Assuming that it now works over a short cable, increase the speed to the maximum required or possible, and transfer test files. Ideally, these should contain continuous (and contiguous) data with just one stop bit. Now repeat the test using the same equipment but with the long interface cable. Finally, perform the tests with the equipment in its final location. If there are any problems during any of the tests, make sure that you note them carefully. Is it character corruption, missing characters, parity errors? Is it a continuous problem, or just occasional? When does it seem to be worse? Do the problems occur at specific times, or at specific points? Can you make it happen at will? Try lowering the speed; try running from adjacent mains sockets, even if it means using a long extension lead; try using two stop bits; try connecting any unused known inputs to a negative voltage or, at a push, pin 7. If you still can’t find anything then look around and listen. Does the problem coincide with the fridge, the lift, certain people or walking in a specific area? Has it ever worked properly? What has been changed since then? If you really can’t find anything then look inscrutable and say that the problem must be at the other end. Suppliers have been using that ploy for years!