The SGI parallel port is intended for interfacing with Centronics or Versatec compatible parallel printers, although it is also possible to use it for simple digital input and output applications. This document explains how to use the parallel port for this type of application.
In the past I have used the port for the following applications:
Other people have contacted me about using the parallel port for different applications, including driving stepper-motors and for timing and synchronising physiological experiments. There must be many other uses for this versatile port.
There is some sample code available that demonstrates how to write data to the parallel port, and explains how to wire up the handshaking signals to allow you to write freely to the port. This is ideal for simple applications that require up to eight digital logic outputs. In this case, you can individually program each output by writing a single eight bit value (0..255) to the parallel port. Each bit controls a single digital output signal.
Not all the SGI machines appear to latch the data that you write to the port, so I have provided a circuit diagram (Figure 1) that illustrates one method of latching the outputs. This circuit is very simple, and may also help to protect the port from external damage. It does, however, require an external 5V power supply - unless you can derive the supply from one of the connectors on the back of the machine (don't try this unless you're sure you know what you're doing!).

Figure 1. Simple circuit to latch the parallel port outputs.
It's also possible to get four digital inputs to the SGI by using the printer status signals. The appropriate pins are listed in the table below. An external signal on any of these pins can be read in using the PLPIOCSTATUS ioctl (described in the plp manual page).
| Pin | Name (SGI) | Normal Function |
| 12 | EOP | End of paper. |
| 13 | ONLINE | Printer is online. |
| 15 | FAULT | Fault on printer. |
| 17 | EOI | End of ink. |
The PLPIOCSTATUS ioctl returns a four-bit value, where each bit represents one of the status signals. The bits are defined in '/usr/include/sys/plp.h', and you should use these if you want to guarantee that your software will work on different SGI machines. Note that the Fault signal is inverted, ie. an external logic low will result in the relevant bit being set when you read it, and vice versa.
The table below illustrates the pinout of the connector on the rear of the computer. The connector is normally a female DSUB-25 connector. Note that a pinout is also available on the plp manual page.
| Pin | Name | Function |
| 1 | /STROBE | Pulses low during write, indicates D1..D8 valid. |
| 2 | D1 | Data. (Least significant bit) |
| 3 | D2 | Data. (Note: D1..D8 bidirectional on some SGI) |
| 4 | D3 | Data. |
| 5 | D4 | Data. |
| 6 | D5 | Data. |
| 7 | D6 | Data. |
| 8 | D7 | Data. |
| 9 | D8 | Data. (Most significant bit) |
| 10 | /ACKNOWLEDGE | Printer pulses low to indicate data received. |
| 11 | BUSY | High indicates that printer is busy. |
| 12 | EOP (PE) | Indicates that printer is out of paper. |
| 13 | ONLINE (SELECT) | Indicates that printer is selected (online). |
| 14 | PR / SC | High for printer, low for scanner (ie. input mode). |
| 15 | /FAULT (ERROR) | Low indicates fault on printer. |
| 16 | /RESET (/INIT) | Computer generates low pulse to reset printer. |
| 17 | EOI (NOINK) | Printer has run out of ink. |
| 18 | not connected | May be ground on some machines. |
| 19-25 | GROUND | Signal ground. Some pins may not be connected. |
/STROBE Signal
The /STROBE signal pulses low to indicate valid data on D1..D8. You can use this signal to strobe the data into a latch, register or to generate an interrupt on some external hardware. On our Indy, the signal isn't very clean, if you use very short strobe lengths the rise time of the pulse is quite long compared to the pulse duration. You might like to clean this up with a 74LS14 schmitt trigger, you get a nice square pulse this way.
D1..D8
These are TTL style data outputs. Some machines latch these lines, some may not. The safest solution is to latch them yourself (see figure 1), then your hardware should work on all machines. On some machines (Indy for example) these lines are bidirectional.When reading data, the pins go to a high impedence state. See the note on PR/SC.
/ACKNOWLEDGE
When the external device has received data from the host (ie. after a /STROBE pulse), it should pulse /ACKNOWLEDGE low to indicate that the transfer was completed successfully. For a simple output only interface, you can tie /STROBE to /ACKNOWLEDGE and get the interface to acknowledge itself. This means that you can write to the port as fast as you like, and use an external latch to store the results. It should be possible to ignore the acknowledge signal from the interface, using the PLPIOCIGNACK ioctl. Unfortunately, this does not appear to work on all machines. On our Indys, this call doesn't seem to make any difference to the way the port works, although I have heard that it works correctly on an Onyx.
BUSY
The external device can take the BUSY signal high to indicate that it's busy and therefore unable to communicate. This is used in printers to indicate that some time consuming task is in progress; moving the printer head for example. If you don't want the BUSY signal, you can tie it to ground.
EOP
The printer takes this high to indicate that it has run out of paper. This input can be read using the PLPIOCSTATUS ioctl, so you can easily use it for a general purpose input.
ONLINE
The printer takes this high to indicate that it's online (selected). Like EOP, this input can be read using the PLPIOCSTATUS ioctl.
PR/SC
This signal appears to indicate whether the port is attempting to read or write data. The pin is normally high (printer mode), but opening the port in bidirectional mode (using /dev/plpbi) and then initiating a read operation causes this pin to go low (scanner mode).
FAULT
The printer takes this low to indicate that there is a fault. Like EOP, this input can be read using the PLPIOCSTATUS ioctl. Note that the value returned is inverted. ie. if the pin is high, the relevant PLPFAULT bit will be zero, and vice versa.
RESET
The host pulses this low to reset the external device. You can generate a reset at any time, by calling the PLPIOCRESET ioctl.
EOI
The printer takes this high to indicate that it has run out of ink. This input can be read using the PLPIOCSTATUS ioctl, so you can easily use it for a general purpose input.
As an experiment, I examined the state of the parallel port pins during read mode. I found that in this mode both PR/SC and /FAULT are pulled low. This suggests that /FAULT becomes an output, although I don't know what it signifies.
If you have any more information that could be added to this document (particularly information about how bidirectional mode operates), or if you have any questions or comments then please contact me
Last updated 17th July 1996, James Ward.