|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Up Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Ads Donate Humor |
|
|
RS-232 Serial Communication Notes6-8-99, 11-20-04 Notes I made during experiments connecting two computers together via their serial ports. Handshaking
HardwareCOM1, COM2
Serial Communication Chips
|
|
Cable must connect a DCE device to a DTE device, or use a null modem cable.
The only DB9 pin I haven't been able to test experimentally is RI, but it does have a DB9 pin assigned to it (MSD reports it, and when I had it crosswired with another, it was detected), and DB9 pin 9 was the only one left that I hadn't tested.
| A | B | C | D | E | F | G |
| 9 pin | 25 pin | Connect | 25 pin | 9 pin | ||
| pin 1 | FG | <------> | FG | pin 1 | ||
| pin 1 | pin 8 | DCD | <------> | DCD | pin 8 | pin 1 |
| pin 2 | pin 2 | Transmit* | <------> | Receive* | pin 3 | pin 3 |
| pin 3 | pin 3 | Receive* | <------> | Transmit* | pin 2 | pin 2 |
| pin 4 | pin 6 | DSR | <------> | DTR | pin 20 | pin 6 |
| pin 5 | pin 7 | SG | <------> | SG | pin 7 | pin 5 |
| pin 6 | pin 20 | DTR | <------> | DSR | pin 6 | pin 4 |
| pin 7 | pin 5 | CTS | <------> | RTS | pin 4 | pin 8 |
| pin 8 | pin 4 | RTS | <------> | CTS | pin 5 | pin 7 |
| pin 9 | pin 22 | RI | <------> | RI | pin 22 | pin 9 |
*DB9/DB25 (DCE/DTE) inherently transmit & receive on different pins, and must. Thus, for a regular connection between those two, it is proper to connect the same-numbered pins, just as you do when using two connectors of the same type.
| From | To | Regular Cable | Null Modem Cable |
| DB25 | DB25 | B - B | B - F |
| DB25 | DB9 | A - B | B - G |
| DB9 | DB9 | A - A | A - G |
Description field is from the point of view of the terminal, DTE, which is the "data terminal".
"Data set" is the modem, which is a DCE device.
| 9 Pin | 25 Pin | Abbr. | DCE-DTE Direction | Description | EIA Circuit | CCITT v.24 |
| 1 | FG | == | Frame Ground. Connects equipment chassis to prevent electrical shock. | AA | 101 | |
| 3 | 2 | TxD | <---- | Transmitted Data (Transmit line for DTE, Receive line for DCE) | BA | 103 |
| 2 | 3 | RxD | ----> | Received Data (Receive line for DTE, Transmit line for DCE) | BB | 104 |
| 8 | 4 | RTS | <---- | Request to Send. (Tells the modem that the TERMINAL or computer is ready to transmit data.) | CA | 105 |
| 7 | 5 | CTS | ----> | Clear to Send. (Tells the terminal or computer that the MODEM is ready to accept data for transmission.) | CB | 106 |
| 4 | 6 | DSR | ----> | Data Set Ready (Indicates that the MODEM is ready to establish the communications link and exchange control characters to begin data transmission.) | CC | 107 |
| 5 | 7 | SG | == | Signal Ground (Return path for signal current) | AB | 102 |
| 1 | 8 | DCD/RLSD | ----> | Data Carrier Detect / Received Line Signal Detector (Indicates that the MODEM has detected the data carrier of the remote modem.) | CF | 109 |
| 9 | v+ | == | + DC test voltage | |||
| 10 | v- | == | - DC test voltage | |||
| 11 | QM | ----> | Equalizer Mode | Bell | 208A | |
| 12 | SDCD/SRLSD | ----> | Secondary DCD | SCF | 122 | |
| 13 | SCTS | ----> | Secondary CTS | SCB | 121 | |
| 14 | STxD | <---- | Secondary TxD | SBA | 118 | |
| NS | <---- | New Sync | Bell | 208A | ||
| 15 | TxC | ----> | Transmitter Clock DCE Source | DB | 114 | |
| 16 | SRxD | ----> | Secondary RxD | SBB | 119 | |
| DCT | ----> | Divided Clock Transmitter | Bell | 208A | ||
| 17 | RxC | ----> | Receiver Clock | DD | 115 | |
| 18 | DCR | ----> | Divided Clock Receiver | Bell | 208A | |
| LL | Local Loopback | |||||
| 19 | SRTS | <---- | Secondary RTS | SCA | 120 | |
| 6 | 20 | DTR | <---- | Data Terminal Ready (Indicates that the TERMINAL or computer is ready to establish the communications link and exchange control characters to begin data transmission.) | CD | 108.2 |
| 21 | SQ | ----> | Signal Quality Detect | CG | 110 | |
| 9 | 22 | RI | ----> | Ring Indicator (Indicates that the modem has received a ring signal on the telephone line.) | CE | 125 |
| 23 | <---- | Data Rate Selector | CH | 111 | ||
| ----> | Data Rate Selector | CI | 112 | |||
| 24 | ETxC | <---- | External Transmitter Clock DTE Source | DA | 113 | |
| 25 | <---- | Busy | ||||
| TM | Test Mode |
|
|
Modem Programs and Serial ProgrammingThere are at least two programs on the site dealing with RS-232 programming, including serial communications C++ classes for MSDOS and Windows. A site Search on RS232, RS-232, or serial might turn up more.
IBM BIOS uses INT 14h for serial communications operations. If you use this, you can do serial programming independent of the actual com port addresses, and don't have to program the ACE chip yourself. INT 14h appears to be able to set all parameters except hardware handshaking options. (Haven't researched this.) But you can program the ACE yourself, and get more flexibility. Commsupp (IBM PC serial support for DeSmet C) does this, and is the best starting point for such a program. See also:
|
|
|
|
|
|
|
|