DB9 pinout: RS-232, CAN and PROFIBUS
The 9-pin D-sub connector, commonly called DB9 (its correct name is DE-9), carries three common links with three different pinouts: the RS-232 serial link, the CAN bus per CiA 303-1 and the PROFIBUS DP fieldbus. The same connector therefore does not mean compatible.
By Hugues Orgitello · Updated ·
RS-232 (TIA-574), DTE side
DTE side (terminal: PC, PLC), on a male connector. Directions are seen from the DTE. On the DCE side (modem, device), the connector is female and every direction flips: the DCE transmits on pin 2.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | DCD | In | Data Carrier Detect (Signal) |
| 2 | RXD | In | Received data (Signal) |
| 3 | TXD | Out | Transmitted data (Signal) |
| 4 | DTR | Out | Data Terminal Ready (Signal) |
| 5 | GND | Signal ground (Ground) | |
| 6 | DSR | In | Data Set Ready (Signal) |
| 7 | RTS | Out | Request To Send (Signal) |
| 8 | CTS | In | Clear To Send (Signal) |
| 9 | RI | In | Ring Indicator (Signal) |
CAN bus (CiA 303-1, now CiA 106)
CAN in Automation recommendation published in CiA 303-1, moved to CiA 106 in 2023; the most widespread on DB9. The device carries the male connector. Pins 3 and 6 are linked inside the device; pins marked optional may stay unconnected.
| Pin | Signal | Description |
|---|---|---|
| 1 | Reserved | Reserved (Not connected) |
| 2 | CAN_L | CAN low line (dominant low) (Differential pair) |
| 3 | CAN_GND | CAN ground (Ground) |
| 4 | Reserved | Reserved (Not connected) |
| 5 | CAN_SHLD | Shield, optional (Shield / earth) |
| 6 | GND | Ground, optional (Ground) |
| 7 | CAN_H | CAN high line (dominant high) (Differential pair) |
| 8 | Reserved | Reserved (Not connected) |
| 9 | CAN_V+ | Optional external supply for isolated transceivers (Power) |
PROFIBUS DP (RS-485)
PROFIBUS DP pinout per IEC 61158 and the PROFIBUS International guidelines, female connector on the device in manufacturers’ practice. Only pins 3, 5, 6 and 8 are mandatory; pin 6 must supply at least 10 mA.
| Pin | Signal | Description |
|---|---|---|
| 1 | Shield | Shield or potential equalization, not recommended: the shield goes through the connector housing (Shield / earth) |
| 2 | M24 | 24 V supply return, optional (Ground) |
| 3 | B (RxD/TxD-P) | Data line B, positive (red wire) (Differential pair) |
| 4 | CNTR-P | Repeater direction control, optional (Signal) |
| 5 | DGND | Data ground, termination reference (Ground) |
| 6 | VP | +5 V to power the bus termination (Power) |
| 7 | P24 | +24 V, optional (Power) |
| 8 | A (RxD/TxD-N) | Data line A, negative (green wire) (Differential pair) |
| 9 | CNTR-N | Repeater direction control reference, optional (Signal) |
An RS-232, RS-485 or CAN interface to design, isolate or protect, or a fieldbus dropping frames? We design the electronics and the firmware and debug it on the scope.
Straight or null-modem cable in RS-232
A DTE connects to a DCE with a straight, pin-to-pin cable. Two DTEs (two PCs, a PC and a PLC) connect with a null-modem cable that crosses the signals: 2 to 3 and 3 to 2, 7 to 8 and 8 to 7, pin 4 at each end to pins 6 and 1 at the other, 5 to 5. Without hardware flow control, a three-wire cable is enough: 2-3, 3-2 and 5-5.
RS-232 levels are not logic levels: a logic 1 is a negative voltage, between −3 and −15 V, a 0 a positive voltage. An RS-232 pin wired straight to a microcontroller’s 3.3 V UART can destroy it; it needs a transceiver (MAX3232 type).
RS-485 on DB9: no universal pinout
The TIA-485 standard defines electrical levels, not the connector. On DB9, every manufacturer has its own pinout, and the only widespread one is PROFIBUS above (B on 3, A on 8). Read the device manual before wiring any RS-485 equipment.
Watch the A and B names too: in PROFIBUS, B is the line that sits positive at idle, while several transceiver makers call their non-inverting output A. A bus that does not answer often has its two wires swapped.
CAN bus: termination and ground
A CAN bus is terminated with 120 Ω between CAN_H and CAN_L at each of its two ends, no more. Powered off, you should measure about 60 Ω between pins 7 and 2. Running the CAN ground (pin 3) between nodes keeps the common mode inside the transceiver’s range.
FAQ
- DB9 or DE-9: which name is right?
- DE-9. In D-sub naming, the letter gives the shell size: E for 9 pins, B for 25 pins. “DB9” stuck in everyday use, and everyone understands it.
- Which DB9 pins are TX and RX in RS-232?
- On the PC side (DTE), pin 3 transmits (TXD) and pin 2 receives (RXD), ground is pin 5. On the device side (DCE), it is the other way round: it transmits on pin 2. Between two DTEs, cross 2 and 3.
- Which DB9 pins are CAN_H and CAN_L?
- Per CiA 303-1: CAN_H on pin 7, CAN_L on pin 2, CAN ground on pin 3. That is the pinout of USB-CAN adapters, diagnostic tools and most industrial CANopen equipment.
- How do you check a CAN bus termination?
- With the bus powered off, measure the resistance between CAN_H and CAN_L (pins 7 and 2). About 60 Ω: both 120 Ω terminations are in place. 120 Ω: one is missing. 40 Ω or less: there are too many.
- TIA-574, 9-position non-synchronous DTE/DCE interface (paid or members-only document)
- CAN in Automation, CiA 106 Connector pin-assignment recommendations (formerly CiA 303-1)
- PROFIBUS International, 9-pin D-sub connector assignment
- Lammert Bies, RS-232 specifications and null-modem wiring
Tables built from these documents and cross-checked against manufacturer datasheets. Always check the datasheet of the connector you actually use: some manufacturers number differently.
- The UART serial link, from frame to electrical level
- CAN, CAN FD and CAN XL bus
- M12 pinout for sensors and fieldbuses
- Embedded firmware development
Other pinouts