Document: portdemo.txt Written : 4/6/96 Author : James Ward (j.w.ward@dcs.hull.ac.uk) Purpose : Brief introduction to the parallel port, possible applications and description of some of the material available from my web-pages, which are located at: www.crema.co.uk 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/output applications. In the past I have used the port for the following applications: * Interface between SGI Indy and PC compatible. This formed a 'fake' bidirectional interface between the PC and SGI, where data transfers from SGI -> PC were achieved using D1..D8, and transfers PC -> SGI were done using four status inputs to transfer data a nibble at a time (four bit chunks). * Interface to my force-feedback system. Again, data is transferred SGI->Device in eight bit chunks, and from Device->SGI as four-bit chunks. * Interface to LCD Shutter Glasses (for displaying 3D graphics on a standard monitor). One data output was used to switch between the left and right eye views, at about 60Hz. 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! I have sample code 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, programmable by writing an eight bit value (0..255) to the parallel port. Not all the SGI machines appear to latch the data that you write to the port, so I have provided a circuit diagram 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!). Note that it's also possible to get four digital inputs to the SGI by using the PE/EOP(12), EOI/NOINK(17), FAULT/ERROR(15) and ONLINE/SELECT(13) signals. If you put some logic signals on these inputs, you can read their state by using the PLPIOCSTATUS ioctl (see the plp manual page), which returns a four-bit value - 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. Finally, if anyone has any questions or comments about this material, please contact me by e-mail (j.w.ward@dcs.hull.ac.uk). You can find the source code and circuit diagram described here at the following location: www.crema.co.uk