| Date: Wed, 8 May 2002 18:45:19 +0100
| From: "Kenn Humborg" <kenn at bluetree.ie>
|
| > On Wed, May 08, 2002 at 06:36:47PM +0100, Mel wrote:
| > >[...] how can I tell if it's a null cable or not?
| >
| > Either you get lucky and have it written on the cable, or you get a
| > multi-meter and see if pins 3 & 4 are swapped (from memory - and it's
| > flaky memory.)
|
| It's pins 2 and 3.
|
| However, the standards for 9-way and 25-way connectors have the
| opposite meanings, so a straight through cable has pin 2 on the
| 9-way connected to pin 3 on the 25-way, while a null modem
| (or crossover cable) has pin 2 on both ends connected together,
| and pin 3 on both ends connected.
|
| Real simple, this RS232 stuff :-)
whilst DB-25 connectors are indeed standardised (at least
de facto if not de jour), historically there are a number
of DB-9 connector conventions floating around --- albeit
(from memory) I believe what Kenn's outlined is the most
common (as in IBM's PC convention).
the approach to tackling this mess I've always advocated
and implemented is to settle on a "unit standard cable",
which is then built-up into whatever you need by using
appropriate adaptors. e.g., your "unit standard cable"
might be DB-25 male on one end, DB-25 female on the other,
connecting pins 2, 3, and 7 (at least, the flow- and modem-
control circuits are also recommended) straight-through,
shielded, with the shielding earthed only at the male end.
( for cables, it's important not to earth the shield at both
ends; for adaptors, it's important to earth at both ends,
as you want a continuous shield from the earthed end to
the other end of a fully-built "cable" --- assuming you
bother with shielding, that is. )
to the extent possible, your adaptors change as few of
the "unit standard cable"s properties as possible.
e.g., your "unit standard null modem" would always be
DB-25 male<->female, but swaps pins 2 and 3 rather than
straight-through. DB-25/DB-9 convertors are a mess, as
you'll wind up needing all four sex combinations in a
fully-equipped cabling kit; but none are null.
then, in a situation like that here, where a null modem
is needed ('cuz two DTEs are being connected) with one
DB-9 end (of unspecified sex), a DB-25<->DB-9 converter
of appropriate sexes plus a null modem would be tacked
on (using the conventions above, could but needn't be
at the same end), and you've the cable you need .....
when you don't know what cable you need, a breakout box
(nominally male DB25<->DB25 female) is invaluable. the
better breakout boxes tend to have both male and female
DB-25 connectors on both sides, which can help. for the
more adventurous, a cable-making kit is useful for building
any adaptors you need (as short cables), but I must admit
these days I tend to just buy the convertors/adaptors I
need (and to pick a pre-made cable as my "unit standard",
making sure there are equivalent models are available from
other suppliers).
it's helpful to label the various adaptors, albeit the only
cables you need label are those which aren't your chosen
"unit standard". (you always seem to have a few!) note
that because the adaptors generally change only one property
at a time, you can often guess what the adaptor does simply
by looking at it. e.g., a male<->male DB-25 is simply that
(not null; a null would be female<->male); a DB-25<->DB-9
is simply that (not null; null modems are DB-25 at both
ends); and so on.
it may be helpful to have various lengths of your chosen
"unit standard" cable, but note that if carefully designed,
multiple such cables can be plugged directly together to
get a longer "unit standard cable" (except the shielding
is broken..... ;-( ).
cheers!
-blf-
p.s. I've no idea if it's still in print, and I've long
still lost my copy, but there used to be a good,
and short, book(let) on RS-232 called something
like ``All You Need to Know about RS-232'' ....
--
Innovative, very experienced, Unix and | Brian Foster Dublin, Ireland
Chorus (embedded RTOS) kernel internals | e-mail: blf at utvinternet.ie
expert looking for a new position ... | mobile: (+353 or 0)86 854 9268
For a resume, contact me, or see my website http://www.blf.utvinternet.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!