| In the serial communications world one of the | | | | transmitted. |
| most enduring specifications is RS232. Indeed, | | | | Before the functions of the key RS232 pins are |
| many personal computers (PCs) still have at least | | | | discussed, the reader should recall the terms 'DTE' |
| one RS232 port, even with the popularity of | | | | and 'DCE'. For the purposes of this article we can |
| Universal Serial Bus (USB) ports. It is partly this | | | | assume that the PC is the DTE (Data Terminal |
| longevity that has created a market for | | | | Equipment) and the dial-up modem it is connected |
| converters to interface between RS232 and | | | | to (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 not | | | | important 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-pin | | | | device (or DCE to DCE) will require a 'null-modem' |
| converters.) In addition, although the standard | | | | cable whereas connecting DTE to DCE will require |
| recommends a maximum distance of just 50 | | | | a 'straight-through' (transmit pin maps to transmit |
| feet, with suitably shielded cable it's possible to | | | | pin, receive pin maps to receive pin etc). This is |
| reach about 10,000 feet, albeit at the slower rate | | | | not 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 key | | | | receive data (RD) pin is where it is received. |
| point is that only three wires are required to | | | | However, note that the receiving DCE will receive |
| communicate data one bit at a time - a | | | | this data on its TD pin when using a |
| transmitting wire, a receiving wire and an | | | | straight-through cable. The other significant RS232 |
| earth-grounding wire. (In practice, additional wires | | | | data 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 synchronizing | | | | The latter two are rarely used in today's modems |
| bits are sent or received and the serial port must | | | | and will not be discussed further. |
| therefore use 'start' and 'stop' bits within the data | | | | The use of RTS/CTS is relevant when hardware |
| stream to indicate when data transmission is | | | | flow control is deployed between the DTE and |
| about to begin (on a per-byte basis) and when it | | | | DCE devices. These pins are used in combination |
| has finished. (Note that in some cases, a special | | | | so that, for example, when the DTE raises the |
| 'parity' bit is also used within the data stream to | | | | signal 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. a | | | | is ready to receive. And what of the DTR/DSR |
| parallel printer port on a PC) uses a continuous | | | | pins? Although originally intended as an alternate |
| stream of bits to allow the two devices to know | | | | hardware flow control mechanism, they are not |
| exactly where the other is - this includes the use | | | | much used any more. |
| of 'idle' bits when no actual data is being | | | | |