Advanced Serial Data Communications (RS232, RS485 and RS422)

In the serial communications world one of thetransmitted.
most enduring specifications is RS232. Indeed,Before the functions of the key RS232 pins are
many personal computers (PCs) still have at leastdiscussed, the reader should recall the terms 'DTE'
one RS232 port, even with the popularity ofand 'DCE'. For the purposes of this article we can
Universal Serial Bus (USB) ports. It is partly thisassume that the PC is the DTE (Data Terminal
longevity that has created a market forEquipment) and the dial-up modem it is connected
converters to interface between RS232 andto (for example) is the DCE (Data
other serial interfaces e.g. RS422 and RS485.Communications Equipment.)
RS232 serial ports usually have a 25-pin (DB-25)Knowing which is DTE and which is DCE is
male connector, although most of the pins are notimportant when connecting RS232 cables. For
required and a 9-pin (DB-9) male is sufficient.example, connecting a DTE to another DTE
(Note that many vendors supply 9-pin to 25-pindevice (or DCE to DCE) will require a 'null-modem'
converters.) In addition, although the standardcable whereas connecting DTE to DCE will require
recommends a maximum distance of just 50a 'straight-through' (transmit pin maps to transmit
feet, with suitably shielded cable it's possible topin, receive pin maps to receive pin etc). This is
reach about 10,000 feet, albeit at the slower ratenot applicable with RS485 and RS422.
of 19,200 bps.From the DTE's perspective the transmit data
It's instructive to review why a 9-pin connector is(TD) pin is where data transmitted and the
adequate for most serial data scenarios. The keyreceive data (RD) pin is where it is received.
point is that only three wires are required toHowever, note that the receiving DCE will receive
communicate data one bit at a time - athis data on its TD pin when using a
transmitting wire, a receiving wire and anstraight-through cable. The other significant RS232
earth-grounding wire. (In practice, additional wiresdata pins are RTS (request to send), CTS (Clear
are used to reliably send and receive the data.)to Send), DTR (data terminal ready), DSR (Data
RS232 serial ports support 'asynchronous'Set Ready), CD (Carrier Detect) and RI (Ring In).
communications. This means that no synchronizingThe latter two are rarely used in today's modems
bits are sent or received and the serial port mustand will not be discussed further.
therefore use 'start' and 'stop' bits within the dataThe use of RTS/CTS is relevant when hardware
stream to indicate when data transmission isflow control is deployed between the DTE and
about to begin (on a per-byte basis) and when itDCE devices. These pins are used in combination
has finished. (Note that in some cases, a specialso that, for example, when the DTE raises the
'parity' bit is also used within the data stream tosignal on the RTS pin because it has data to send,
help improve data integrity and error checking.)the DCE at the other end will raise its CTS pin if it
In contrast, synchronous communications (e.g. ais ready to receive. And what of the DTR/DSR
parallel printer port on a PC) uses a continuouspins? Although originally intended as an alternate
stream of bits to allow the two devices to knowhardware flow control mechanism, they are not
exactly where the other is - this includes the usemuch used any more.
of 'idle' bits when no actual data is being