Serial Communications
Introduction
Serial communications makes use of data bit encoding on wave carriers to transmit information from one
device to another. The sending and receiving devices process the data stream one bit at a time that is serially.
There are numerous standards for serial communication that have been developed, the most prevalent
from the Electronics Industry Association (EIA) are discussed below. These standards are commonly
referred to as Recommended Standards (RS) but have more recently been renamed as EIA or TIA standards.
Refer also to Transmission which discusses how digital transmission occurs
and Data Encoding that describes character and data stream encoding techniques.
RS-232
See Modem Setup for detail on RS-232 signalling on a modem.
Recommended Standard 232 was originally put forward in 1962 for point-to-point serial communication between
Data Circuit Terminating Equipment (DCE), such as a modem,
and Data Terminal Equipment (DTE), such as a data terminal. The standard covers
voltage levels, signalling rates, pinouts and circuits for the interfaces to equipment. The name for the standard
has changed frequently, the latest name being TIA-232-F issued in 1997. The revision 'C' issued in
1969 is the one most known and was issued to deal with the electrical characteristics of data terminals
that were then becoming commonplace. Although RS-232 is a standard, there have been many unofficial modifications
by manufacturers as they have adapted the RS-232 characteristics to increase speed and to change voltage levels.
Many data equipment still now incorporates an RS-232 port.
Separate DTE and DCE circuits manage the data stream between the devices. As such RS-232 can handle
duplex communication, plus it is able to manage synchronous and asynchronous communication.
Voltage levels are used to represent logical '1' and logical '0'. The range of voltages that can be
used are +3v to +15v (for logical '0' known as Active or space) and -3v to -15v
(for logical '1' known as Idle or Mark). The circuitry must be
designed to withstand an open circuit with voltage levels up to 25v. Manufacturers vary as to the voltages
that they may use. Ground is common to both ends of the cable so the signal is unbalanced and liable to
'Ground shift', this Single-ended Signalling method has one wire grounded whilst the other wire
carries the voltage signal.
As far as the connector is concerned the standard recommended a 25-pin D-subminiature (D-sub) connector.
There are however many connector types used by manufacturers:
Signal Type |
Direction from DTE |
DB-25 (EIA-530) |
DB-9 (TIA-574) |
MMJ |
Cisco RJ-45 |
Hirschmann RJ-45 |
EIA/TIA 561 |
RJ-50 |
Yost |
Common Ground (G) |
� |
7 |
5 |
3,4 |
4,5 |
4 |
4 |
6 |
4,5 |
Transmitted Data (TxD) |
Out |
2 |
3 |
2 |
3 |
3 |
6 |
8 |
3 |
Received Data (RxD) |
In |
3 |
2 |
5 |
6 |
5 |
5 |
9 |
6 |
Data Terminal Ready (DTR) |
Out |
20 |
4 |
1 |
2 |
- |
3 |
7 |
2 |
Data Set Ready (DSR) |
In |
6 |
6 |
6 |
7 |
- |
1 |
5 |
7 |
Request To Send (RTS) |
Out |
4 |
7 |
- |
1 (Aux only) |
- |
8 |
4 |
1 |
Clear To Send (CTS) |
In |
5 |
8 |
- |
8 (Aux only) |
- |
7 |
3 |
8 |
Data Carrier Detect (DCD) |
In |
8 |
1 |
- |
- |
- |
2 |
10 |
7 |
Ring Indicator (RI) |
In |
22 |
9 |
- |
- |
- |
1 |
2 |
- |
- Received Data (RxD) - Data sent from the DCE to the DTE.
- Transmitted Data (TxD) - Data sent from the DTE to the DCE.
- Request To Send (RTS) - Set to '0' by the DTE to prepare the DCE to receive data.
The DCE may need to transmit a carrier or reverse the direction
- Clear To Send (CTS) - Set to '0' by the DCE to acknowledge RTS and allow the DTE to transmit.
- Data Terminal Ready (DTR) - Set to '0' by the DTE to indicate that it is ready to be connected. e.g.
to 'wake up a modem.
- Data Set Ready (DSR) - Set to '0' by the DCE to indicate an active connection. If DCE is not a modem (e.g. a null
modem cable or other equipment), this signal should be permanently set to '0', perhaps by linking the pin to another
pin that is permanently set to '0'.
- Data Carrier Detect (DCD) - Set to '0' by the DCE when a connection has been established with remote equipment.
- Ring Indicator (RI) - Set to '0' by the DCE when it detects a ring signal from the telephone line.
- Common Ground (G) - a common ground can cause a problem if the cable between the devices runs over a long
distance e.g. between buildings. This is because the potential to ground may be different for each end.
Cables can be shielded or unshielded and can be the recommended maximum length of 15m (50ft) or longer if the cable used
has low capacitance. Sometimes up to 50m has been known. The standard declares the maximum transmission rate
as being 20kbps, although this is now consistently exceeded with the quality of cables and connectors available.
You can have a minimal '3-wire' RS-232 connection made up of TxD, RxD, and G, and this is used when the full facilities
of RS-232 are not required. When only flow control is required, then the RTS and CTS lines are also included in a 5-wire version.
Handshaking
The RS-232 standard uses RTS and CTS in an asymmetrical manner. The DTE sets RTS to '0' in order to indicate that
it wants to transmit to the DCE. The DCE then sets CTS to '0' in order to grant permission. This allows for
half-duplex modems that disable the transmitters when they are not needed.
A preamble must be transmitted to the receiver for synchronisation when the transmitters are re-enabled.
The DTE is unable to indicate that it cannot accept data from the DCE.
There is a non-standard symmetrical alternative where the CTS indicates permission from the DCE for the DTE to transmit,
and RTS indicates permission from the DTE for the DCE to transmit. The 'request to transmit' is implicit and continuous.
With this alternative usage, one can think of RTS asserted (logic '0') meaning 'ready to receive characters' from
the DCE, rather than a 'request to transmit' to the DCE.
The data rates and the way data is framed is not part of the RS-232.
RS-423 (EIA/TIA-423-B) is almost identical to RS-232 other than it uses a lower signalling voltage (+/-6v)
and is able to carry a data rate up to 100kbps. In addition, RS-423 is able to support up to 10 multiple receivers
(Multi-drop).
RS-422
A problem with RS-232 is that it has a common ground, it is Single-ended. This limits the distance that
the signal can travel due to changes in the ground potential. To resolve this RS-422, now officially known
as ANSI/EIA/TIA-422-B, uses Balanced or Differential Signalling. This uses a technique of
sending two complementary signals down two wires. The receiver then compares the difference of the two signals
to obtain the actual signal. The benefit of this is that it does not matter if there are ground changes between one end
and the other. RS-422 is not concerned with connectors or bit encoding.
The single-ended systems need higher voltages to overcome noise. Differential systems can use lower voltages (up to
a maximum of +/- 6v for RS-422) and are therefore more suited to sensitive electronic environments.
The maximum cable length for RS-422 is 1200m and the data rates are 10Mbps at 12m or 100Kbps at 1200m, although
a maximum data rate is not specified. RS-422 is used often to extend RS-232 signalling by converting from the
the RS-232 unbalanced signal to the balanced RS-422 signal for the duration of the long run before converting back to
RS-232 at the far end.
RS-232 operates with one Driver (DCE) and one receiver, however RS-422 operates with one Driver circuit
(that cannot be switched off) and can Multi-drop.
or Party Line. This means that there can be up to 10 receivers for the one Driver. There can only be one Driver.
RS-485
RS-485 (EAI/TIA-485-A) employs differential signalling in the same manner as RS-422 and can run
35Mbps up to 10m and 100kbps at 1200m. Provided that the difference in signals is greater than 0.2v
then the voltage highs and lows can be anywhere between -7v and +12v.
Whereas with RS-422 the driver circuit was continually on, with RS-485 a signal has to be sent to the driver circuit
in order to enable it to transmit. This means that you can have multiple receivers.
In fact, the standard specifies up to 32 drivers and 32 receivers on a single (2-wire) bus.
The wires should be arranged as a connected series of point-to-point, or multi-dropped nodes i.e. a line or bus.
The two ends of the cable require a termination resistor (equal to the cable impedance) connected across the two wires. Without these,
reflections of fast driver edges can cause multiple data edges that can lead to corruption of the data. Bias resistors are
also required long the lines as these will bias the voltages so that the receiving circuitry does not misinterpret
noise as data signals. When signalling the master device does the biasing and is located centrally
with slave devices on the edge of the circuits.
RS-485 can operate in a hub-spoke arrangement however this is not recommended as there could be reflection issues.
With 'automatic' repeaters and high-impedance drivers/receivers RS-485 can be extended to hundreds of nodes on a network.
RS485 drivers are able to withstand 'data collisions' (bus contention) problems and bus fault conditions, this is achieved
by forcing the drivers to remain in receive mode until instructed otherwise, primarily by the start bit of a transmission
that automatically switches on the transmit circuitry.
|