Serial Loopback Testing


Subject: Serial Loopback Testing

Problem:
I think my serial ports are bad. How do I test them?

Explanation:
There are two ways that customer service typically tests out the serial ports, both of which use an external null-modem (serial loopback) cable which you can build yourself.

Solution:
To build a ttya-to-ttyb serial loopback cable we use an eight-wire cable connected to two femal DB25-type connectors. The wiring is as follows (see below for wiring diagram):

  1. Pins 6 & 8 on each connector should be wired together;

  2. Pins 15, 17 & 24 on each connector should also be wired together;

  3. Pin 20 on each connector should be connected to the wired-together pins 6 & 8 on the other connector;

  4. Pin 7 of the first connector should be connected to pin 7 on the other connector;

  5. Pin 2 of each connector should be connected to pin 3 on the other connector; and

  6. Pin 4 of each connector should be connected to pin 5 on the other connector.

     Connector 1                       Connector 2
     ===========                       ===========
     2 -------------------\/-------------------- 2   TX-data
     3 -------------------/\-------------------- 3   RX-data
     
     4 -------------------\/-------------------- 4   RTS
     5 -------------------/\-------------------- 5   CTS
     
     6 -------|                         |------- 6   DSR
     8 -------|                         |------- 8   DCD
     20-------|-------------------------|-------20   DTR
     
     7 ----------------------------------------- 7   Signal GND
     
     15-------|                         |-------15   RX Clk
     17-------|                         |-------17   TX Clk
     24-------|                         |-------24   RX Clk

Now, use this cable to connect both ports together (you must connect this cable between the serial a and serial b connectors on the 'break-out' box originally shipped with your BriteLite or PowerLite. This 'break-out' box must then be connected to the back-panel of the system serial/parallel port with the 36-pin cable also originally shipped with the system.)

PowerLite users please note that you must perform three additional steps before booting up your system and testing our the serial-loopback cable. They are: 1) Disable the Xpressfax software (comment out the Xpressfax startup lines in the file '/etc/rc.local'), 2) Change the EEPROM setting from faxmodem?=true to faxmodem?=false, and 3) Execute the boot-prom routine select-ttyb by typing that command at the boot-prom ok prompt before boot-up.

Now peform one of the following operations:

A) Run the 'sundiag' program in loopback mode ('/usr/diag/sundiag/sundiag' on Solaris 1.x, or '/opt/SUNWdiag/bin/sundiag' under Solaris 2.x); or

B1) Log in as 'root' and check that there are only two lines of '/etc/ttytab' containing the devices '/dev/ttya' and '/dev/ttyb', and that they read exactly as follows:

ttya "/usr/etc/getty std.9600" unknown off local secure"
ttyb "/usr/etc/getty std.9600" unknown off local secure"

B2) start 'openwindows' (by typing /usr/openwin/bin/openwin);

B3) Use the rightmost mouse-button to highlight the 'programs' menu-pick, which will allow selection of 'Shell Tool'. Do this twice, which will result in two windows being displayed on the screen. Now use the mouse to position the two windows side-by-side. Next, position the mouse-cursor in the rightmost window and type the following:

# cat < /dev/ttyb

This windows will appear to "hang."

B4) Now position the cursor to the leftmost window and type:

# cat /etc/passwd > /dev/ttya

The contents of the '/etc/passwd' file will be displayed in the rightmost window. If it is not (assuming that all connections have been made correctly), there may be a problem with the serial ports. You can test the serial ports in the other direction (from b to a) by reversing the names ttya and ttyb in steps B3 and B4 above (also note that either of the commands in these windows may be interrupted with control-c).