The ordinary personal computer makes convenient automated testing possible on an everyday budget. In general, the PC-based system is usually dedicated to testing a specific component or circuit. Large-scale automatic test equipment (ATE), on the other hand, provides tremendous flexibility by allowing complex testing of many different types of devices through software modifications. But this capability comes at a price: ATE can cost upwards of a million dollars.
One of the easiest ways to connect test equipment and the device under test (DUT) to a personal computer is through the PC's parallel port. This port serves as a convenient connection for small, cost-sensitive test applications. It also is a useful tool for quickly prototyping a circuit.
A parallel port, which is standard equipment on nearly every IBM-compatible PC, can be connected directly to TTL/CMOS circuits. The standard parallel port provides 12 logic outputs and five inputs. Furthermore, software design is simple because the PC parallel port is easy to program using either C or Basic.1
Because PCs contain the hardware necessary to operate the parallel port, there's no need to open the PC to install a card. Using the parallel port thereby eliminates the risk of electrostatic discharge damage due to improper handling procedures while the computer is open.
Engineers connect the parallel port to various types of interfaces. A parallel port often drives two-wire I2C interfaces. The I2C standard specifies that I2C transmitters provide logic signals via open-collector outputs, so the interface circuitry can be as simple as a single open-collector inverter IC, like the 74HC05. Figure 1 illustrates a parallel-port-to-I2C interface that transmits and receives data to and from a DUT.
Beware Of Parallel-Port Pitfalls
Although there are advantages to communicating via the parallel port, a number of minor pitfalls accompany its use. For example, when using programs written for Microsoft Windows, only as many as four unused parallel-port input pins can be dedicated to the application. The limitation occurs because programs written for Windows cannot reliably determine the address of the parallel port. Connecting one of the output pins of the parallel port to one of its input pins allows software to automatically determine the parallel-port address. Doing so, however, reduces the number of usable input pins to four. A more difficult problem can occur if voltages that exceed the supply rails make contact with any of the circuitry connected to the parallel port. These voltages can destroy the circuitry external to the computer, as well as the parallel port itself.
A way to guard against excessive voltage is to include a circuit-protector IC, such as the MAX367 (Fig. 1, again). When voltage applied to either side of any protector within this chip exceeds the supply rails, the resistance of the specific protector becomes very high, preventing appreciable current from flowing through it. This high resistance also acts to limit the voltage to within the supply rails. This way, it prevents any high voltages inadvertently placed on its SCL, SDA, or DUT-+5-V pins from damaging either the interface circuitry or the parallel port itself.
Other minor problems can crop up when using the PC parallel port. Because only a small amount of power can be drawn from the unused parallel-port output pins (no more than 10 mA with the output voltage perhaps dropping as low as 3 V), an external power supply might be required. However, a carefully designed micropower system may eliminate that need.
Another possible problem is variation of parallel-port logic levels from one PC to the next. Different computer manufacturers use different output drivers (i.e., S, TTL, LSTTL, CMOS) within their computers, so some drivers provide output levels close to 5 V, while others are nearer to 3 V.
Additional problems can arise when a low-budget test system shares a computer that runs other applications. For example, when a computer includes a print driver, that driver may maintain control of the parallel port, even when nothing is being printed. Because most PCs include only one parallel port, no communication with test equipment via the port is possible under these conditions. Another source of possible bus contention is software protection keys that plug into the parallel port.
Today's computers typically include enhancements that allow bidirectional communication via the parallel port. The relatively modern ECP and EPP standards permit the parallel port to automatically transfer blocks of data to and from the PC (i.e., bidirectionally). Sometimes the system BIOS disables these enhancements, and sometimes PCs that include these enhancements are incompatible with other computers.
When communication with the test system must be accomplished with precise timing, the parallel port might not be the right selection. The periodic intervals when the main processor refreshes the PC's dynamic memory often cause the waveforms synthesized by the parallel port to be "jittery." Even worse, when using Windows, the program driving the parallel port may be periodically interrupted. Although all programmed events happen in the correct order, exact timing of these events isn't assured.
The PC serial port, sometimes called the RS-232 port, provides another easy method for connecting a PC to a DUT. Like the parallel port, the serial port is available on most PCs, and an interface need not be installed. Unlike the parallel port, which uses logic-level voltages, the serial port employs signal voltages that swing both positively and negatively. The transmitter voltage levels required by the RS-232 specification are at minimum ±5 V. In reality, voltage levels can vary from ±3 to ±30 V. The logic-level variations associated with a parallel port don't occur with a serial port because, after receiving the RS-232 signals, an RS-232 receiver provides a logic-level output close to the voltage of the supply powering the receiver (provided that the output is lightly loaded).