Skip to content
AESTECHNO
Pinout

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.

RS-232 (TIA-574), DTE side. Male connector (pins) seen from the front. 1 DCD 2 RXD 3 TXD 4 DTR 5 GND 6 DSR 7 RTS 8 CTS 9 RI
Male connector (pins) seen from the front
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.

CAN bus (CiA 303-1, now CiA 106). Male connector (pins) seen from the front. 1 2 CAN_L 3 CAN_GND 4 5 CAN_SHLD 6 GND 7 CAN_H 8 9 CAN_V+
Male connector (pins) seen from the front
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.

PROFIBUS DP (RS-485). Female connector (sockets) seen from the front. 5 DGND 4 CNTR-P 3 B 2 M24 1 Shield 9 CNTR-N 8 A 7 P24 6 VP
Female connector (sockets) seen from the front
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 interface to design?

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.

Frequently asked questions

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.
Sources

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.

Further reading

Other pinouts