|

A Guide to online information
about:
RS-485
Multidrop Networking
by Benjamin
Day
Introduction
RS-485, due to its low-cost, simplicity,
and robustness, has become widely used in many industrial networking
applications. Many microcontrollers provide a serial port that can
become a node on an RS-485 network with the addition of an inexpensive
RS-485 transceiver. RS-485 wiring uses simple and inexpensive twisted
pair wiring. And RS-485's use of differential transmission makes it
quite robust even in noisy industrial environments.
Unfortunately, RS-485 is only a physical
layer interface. And even then, there is no specification for connectors.
You are on your own with respect
to the higher layer protocols.
The need for additional protocols is
clear when you consider that RS-485 allows for multiple nodes to connect
to the same wire, much the same as party-line phone service did in
decades past. When you wanted to use a phone on a party-line, you
had to pick up the handset and listen first to make sure nobody else
on the party-line was talking already. If the line was clear, you
were free to dial out. If more than one party tried to use the phone
at the same time, the result was confusion. The same is true for RS-485.
Every node on the network can generally listen at the same time. However,
only one node can talk at any given time. If more than one node attempts
to talk at once, the message will be garbled. So, a higher level protocol
is necessary to ensure that every node will get a chance to talk and
that its message will get through ungarbled.
Some systems deal with this problem partly
through wiring. Some systems will require that one device be a master
and all others slaves. Then the transmitter of the master is wired
to the receiver of all the slaves and vice versa. Then there will
be no problems as long as the slaves accept the rule that slaves only
speak when spoken to.
However, the master/slave relationship
does not always fit well. Often, a peer relationship better describes
the interactions between network nodes. In order to realize such a
relationship in an RS-485 network, it will be necessary to have some
higher-level protocols.
OSI Network Model
To understand networking in general,
you should be aware of the OSI Network Model. A network can be described
as having several layers of functionality. The OSI Network Model defines
seven layers of functionality which from highest level to lowest level
are: application, presentation, session, transport, network, data
link, and physical.
If you are thinking about creating your
own networking protocol, you may want to study the OSI model and data
communications in general, before you get too far along. A good place
to start would be with the textbook Data
and Computer Communications
by William Stallings.
How many of the OSI layers will be needed
in your application will depend on the capabilities you wish to achieve
in your network. But, assuming a peer-to-peer network, you'll minimally
need to have a data link layer. Without it, you'll have a party-line
nightmare. The data link layer will ensure that messages are not garbled
and will permit everyone an opportunity to talk.
Additional protocols may also be necessary
if you wish to route traffic from your network to other networks.
Or, if you have multiple applications on a single node that may need
to talk at the same time over the network.
Of course the easiest solution would
be to use an existing protocol.

Cimetrics offers BACnet,
a sophisticated network protocol originally designed for communications
of environmental systems. It works over a variety of physical layers
including RS-485 and Ethernet. Cimetrics also offers a simple 9-bit
serial protocol well suited to standalone RS-485 networks.
High Tech Horizon has developed
a free and open protocol called SNAP
or Scalable Node Address Protocol that can be used with half-
and full-duplex, master/slave, and peer-to-peer systems.
Chip Vendors
A variety of chip vendors
provide RS-485compliant transceivers. A few of these vendors
also offer UARTs in case the microcontrol-ler you are using does not
have a suitable one. This should give you a few places to look for
a transceiver or UART to meet your needs.

Analog Devices offers several
RS-485 transceivers with a variety of features including ESD protection.
Some of their parts can also be cross-referenced
to compatible devices from other suppliers, in case you need second
sourcing.

Burr-Brown's Isolated
RS-485 Differential Bus Transceiver integrates the functionality
of an optocoupler and an RS-485 transceiver in a single chip. The
chip uses Burr-Brown's capacitively coupled isolation technology in
place of an optocoupler.

Exar offers a
UART with automatic RS-485 half-duplex control. The UART also
sports 128-byte receive and transmit FIFOs which are a real plus for
high transfer rates.

Maxim offers a 3.3V
RS-485 transceiver that conforms to the industry standard pinout.

National has a large selection
of RS-485
transceivers. National also offers an RS-485
bus repeater. National's FailSafe Transceiver offers the added
benefit that its receiver enters a known state during floating line,
idle line, and line fault conditions. National offers several useful
appnotes.
Other Resources
The resources listed here
should help you get into the meat of
RS-485.
B&B
Electronics provides a helpful technical
library, which includes a General
appnote on RS-485, An appnote on the Basics
of RS-485 and an appnote on Cable
Selection.
National Semiconductor has
a helpful appnote
that addresses the problem of dealing with an unknown bus state
when all drivers are in an off state. National also has an appnote
that should be helpful in addressing network
termination needs.
If you would like to buy
a copy of the RS-485 standard, you can find at the Global
Engineering Documents web site when you search for document number
TIA/EIA-485.
The following magazine articles
are also quite informative and helpful.
"Controlling the Transmit
Enable Line on RS-485 Transceivers", Nigel Jones, Embedded Systems
Programming, August 1999.
UARTs
make possible low-cost networks of embedded systems, Jim Butler,
EDN Magazine, March 1995.
"Ten
ways to bulletproof RS-485 interfaces", John Goldie, EDN Magazine,
August 1996.
Programming
and Interfacing the 8051 Microcontroller/Book and Disk by Sencer Yeralan,
Ashutosh Ahluwalia (I have included a reference to this book,
even though you may not be interested in the 8051, there is a section
on implementing an RS-485 multidrop network, including information
on a simple network protocol.)
If you would like
to add any information on this topic or request a
specific topic to be covered, contact Benjamin
Day. Ben Day works for Schweitzer Engineering Laboratories
in Pullman, Washington making electric power safer, more reliable,
and more economical.
Circuit Cellar provides up-to-date information
for engineers. Visit www.circuitcellar.com
for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe
online. ęCircuit Cellar, the Magazine for Computer Applications.
Posted with permission.
|