Issue
151 February 2003
Working
the Net
by
Tom Cantrell
Shouldn’t
every engineer know a little more about the process
of network-enabling his or her widget? Tom definitely
thinks so. With Tom on your side, you’ll be working
the ’Net to your advantage in no time.
Start
Web Site Lite COM
Spi with Me
Freshen Up Burning
Down the 'Net Have It Your
Way Sources
and PDF
Word
comes down from on high: "We’ve got to network-enable
our widget!"
As
a design engineer bombarded by management mandates,
you may sometimes feel your job is not to reason why,
only to do or die. But, when it comes to getting embedded
applications on the I-way, believe me when I say that
you (and everybody else involved) had better understand
why, or you won’t know what to do. Worse yet, you’ll
do something you’ll be sorry you did.
The
fact is, your first response needs to be, "Er,
what exactly do you mean by network-enable?" That
should give everybody something to chew on. Let’s try
to come up with a few answers as we take a look at a
gaggle of gadgets that, each in their own way, bring
the ’Net to embedded apps (see Photo 1).
 |
| Photo
1—Moving clockwise from the top left, you can see
the i2Chip IGM7100, Lantronix CoBox Micro, NetBurner
SB72, and SitePlayer. These are evaluation setups
with the base modules plugged into carrier boards
that include the RS-232 level shifter and connector,
and, in the case of i2Chip and SitePlayer, the Ethernet
PHY and connector. |
ETHER
OR NOT
Over
the last decade, most corporations have had to migrate
from whatever proprietary, ad-hoc networking lash-up
they had before, some of which were schemes going as
far back as the Bronze Age of the mainframe and minicomputers.
Big-iron legacy applications and hardware die hard,
so the transition typically doesn’t happen overnight.
It’s
easier to change the wire than the proprietary software
and 24/7 devices behind it. In the course of enterprise
IT reconfiguration, it’s not hard to imagine situations
in which there is a need to maintain some proprietary
RS-232-based hardware and software across the transition
to TCP/IP and Ethernet.
Consider
an existing application with a factory-floor, RS-232
device—perhaps an electronic scale, ticket printer,
or bar code reader—hard-wired to a PC. Having run Ethernet
cable hither and yon, now what? Neither the existing
application software running on the PC nor the RS-232
device knows anything about Ethernet, not to mention
the Internet.
The
solution is conceptually simple: turn the Internet into
a virtual RS-232 cable with products like the Lantronix
CoBox or i2Chip IGM7100. In essence, they’re RS-232-to-Ethernet
converters. Connect one of them to the COM port on your
PC and one to the RS-232 port on your embedded device.
Now, you’ve got Ethernet jacks at each end, and you
can plug in an Ethernet cable, or for that matter, the
entire Internet in-between them.
The
beauty of the scheme is that it’s transparent to the
application hardware and software at each end. Both
the PC and embedded device continue to talk to their
UARTs, blissfully unaware that traffic is actually moving
over the network.
You
can cut back to just one adapter if the PC has a built-in
Ethernet port, which will be the most likely case given
the entire scenario revolves around upgrading to a network.
Normally that would call for rewriting the software
on the PC to talk to the Ethernet instead of the COM
port. An easier approach is to use COM port redirector
software that installs a driver to trap COM port-related
OS calls and routes them via the Ethernet port.
That’s
the approach I took, using the redirector software that
came with the Lantronix box. Sure enough, I was able
to connect an existing RS-232-based application to both
the Lantronix and i2Chip boards. Everything worked just
as advertised (i.e., exactly as before without software
changes).
There
is one thing to watch out for, though. The serial port
on both of these converters is designed to plug directly
into a PC to provide an alternate path (instead of Ethernet)
for downloading and configuration. But, that means when
you unplug your embedded device from the PC’s COM port
and plug it into the converter’s serial port, you have
to perform the old DTE-DCE switcheroo (i.e., swap the
TX and RX pins). Don’t toss your RS-232 breakout box
just yet. The more things change the more they stay
the same.