Parent

Serial Loopback Tests


CONTEXT: Serial ports of type RS-232 on the IBM 5150 (IBM PC) and IBM 5160 (IBM XT)
NOTE: For educational purposes, the following is simplified
NOTE: Loopack tests are not the only tests that are done on a serial port


Normal operation

Before we get into 'loopback', you need to understand some fundamentals.
Click here to see a reference diagram.
* The heart of the serial port is the UART chip (coloured in blue).
* The UART transmits/receives signals at TTL levels, essentially 0 volts and +5 volts.
* The level converters convert the signal voltage between TTL levels and RS-232 levels.


Diagnostic software

When a user goes to execute the serial port test part of diagnostic software, the user is normally asked to specify whether or not a serial loopback plug has been connected to the port under test.
If the user specifies no, then of the loopback tests, the diagnostic software will only run an 'internal loopback' test.
If the user specifies yes, the diagnostic software will normally run both an 'internal loopback' test followed by an 'external loopback' test.


Internal loopback test

The UART chip used in serial ports for the IBM 5150/5160 contains functionality that is referred to as 'loopback' mode.
The diagnostic software puts the UART into loopback mode.
Click here to see a diagram that shows the UART in loopback mode.

What the diagnostic software now typically does is:
      1. Instructs the UART to transmit a specific byte, then verifies that the UART has received a byte, and that byte is the same byte as was sent.
      2. Repeats step 1 multiple times, each time using a different byte (looking for stuck bits and shorted bits).
      3. Instructs the UART to change the state of the RTS signal, then verifies that the UART indicates that the CTS signal changed state as well.
      4. Instructs the UART to change the state of the DTR signal, then verifies that the UART indicates that the DSR signal changed state as well.
      5. Instructs the UART to change the state of the OUT1 signal, then verifies that the UART indicates that the RI signal changed state as well.
      6. Instructs the UART to change the state of the OUT2 signal, then verifies that the UART indicates that the DCD signal changed state as well.

As you can see by the diagram, the 'internal loopback' test does not test the serial port's level converters.
This is where the 'external loopback' test comes into play.


External loopback test

Here, a serial loopback plug is placed on the external connector for the serial port under test.
Electrically, the scenario is now per the diagram here.

What the diagnostic software now typically does is:
      1. Verify that the UART is not in loopback mode.
      2. Instructs the UART to transmit a specific byte, then verifies that the UART has received a byte, and that byte is the same byte as was sent.
      3. Repeats step 2 multiple times, each time using a different byte (looking for stuck bits and shorted bits).
      4. Instructs the UART to change the state of the RTS signal, then verifies that the UART indicates that the CTS signal changed state as well.
      5. Instructs the UART to change the state of the DTR signal, then verifies that the UART indicates that the following 3 signals also changed state: DSR, RI, DCD


IMPORTANT:  For Toshiba laptops, Toshiba's looback plug (they call it a 'RS-232C Wraparound Connector') loops/wraps different pins.
                     And so if you are using Toshiba's diagnostic software, you need to use Toshiba's looback plug.