Forums/Tips, Tricks & Other Useful Info

RS232 / RS422 / RS485 DB9 & DB25 serial port pinouts and loopback wiring

shadeBlue Software August 19, 2011

The source content is published at:

http://zone.ni.com/devzone/cda/tut/p/id/3450

 

DE-9 (DB9) Connector

The DE-9 connector is the most common serial connector.  This connector is found on National Instrument’s one and two port serial interfaces.

Figure 1: Pinout diagram for DE-9 Connector

 To perform a loopback test with no hardware flow control, you will need to connect pins 2 and 3 for RS-232 and pins 4 to 8 and 5 to 9 for RS-422/485.  These connections can be seen in redbelow (figure 2 for RS-232 and figure 3 for RS-422/485). 

When using hardware flow control, you will need to connect pins 4 to 6 and 7 to 8 for RS-232.  Pins 7 and 8 are used for RTS/CTS hardware flow control where pins 4 and 6 are used for DTR/DSR hardware flow control.  For RS-422/485, you will need to connect pins 2 to 3 and 6 to 7.  Both of these connections are required for RTS/CTS hardware flow control since RS-422/485 have differential connections.  These connections can be seen in blue below (figure 2 for RS-232 and figure 3 for RS-422/485).

Figure 2: RS-232 female DE-9 plug with connections required for loopback test

Figure 3: RS-422/485 female DE-9 plug with connections required for loopback test

DB-25 Connector

This connector is not as common as the DE-9 connector.  This connector can still be used to perform a loopback test with a method similar to the one used for the DE-9 connector.

Figure 4: Pinout diagram for DB-25 Connector

Most of the pins on DB-25 connectors are not connected since only nine pins are used for RS-232, RS-422, and RS-485 communication. 

To perform a loopback test with no hardware flow control with a DB-25 connector, connect pins 2 to 3 for RS-232.  For RS-422/485 connect pins 5 to 20 and 7 to 22.  The required connections can be seen in red on figures 5 and 6.

For hardware flow control using RS-232, pins 4 and 5 must be connected along with pins 6 and 20. When using RS-422/485, pin 5 must connect to pin 20 and pin 7 must connect to pin 22.  This will allow the loopback test to use the proper flow control lines.  These connections can be seen in blue on figures 5 and 6.

Figure 5: RS-232 female DB-25 plug with connections required for loopback test

Figure 6: RS-422/485 female DB-25 plug with connections required for loopback test

10P10C (RJ50) Connector

This connector is most commonly found on National Instrument’s 4 port serial interfaces.  The National Instrument 4 port serial interfaces come with 4 10P10C to DE-9 male converter cables. 

Figure 7: Pinout diagram for RJ50 Connector

It is not recommended to use the 10P10C connector by itself to perform a loopback test due to the small separation between pins.  Using a 10P10C to DE-9 connector (Part Number 192190-01), a looback test can be performed using the methods described above. 

 

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

 
Topic is closed for comments