320-Circuit Parallel Port Controller

Main controller board populated with 138 decoders and 374 flip-flop ICs, 2008

Note: The information on this page is rather old and was never fully completed. Although this can technically still be built and used today, there are much better solutions available. This page is kept for historical reference only. If you are looking for an inexpensive DIY AC solution that also supports dimming, check out the Renard set of solutions.

Standard disclaimer: I’m not responsible for anyone hooking these circuits up and the results that follow their use.

After the 2001 season, I wasn’t sure how to expand beyond the original 8-port design. Luckily, I came across Hill Robertson’s design that can control up to 320 individual circuits. I modified it slightly, but it is really still the same design.

(Note: If you need a much smaller number of circuits, check out the original 8-port design. These can always be converted to work with this design with little effort.)

The Parallel Port

The parallel port was a great way to interface a PC to external devices because (at the time) every PC has one, and it’s easy to program. The parallel port has 8 output wires (OUTPUT), 5 input wires (STATUS), and 4 that are bi-directional (CONTROL).

PinLabelFunctionType
1C0 (~)StrobeControl
2D0Data Bit 0Output
3D1Data Bit 1Output
4D2Data Bit 2Output
5D3Data Bit 3Output
6D4Data Bit 4Output
7D5Data Bit 5Output
8D6Data Bit 6Output
9D7Data Bit 7Output
10S6AcknowledgeStatus
11S7 (~)BusyStatus
12S5PE: Paper Tray EmptyStatus
13S4Printer On-LineStatus
14C1 (~)Auto Linefeed After Carriage ReturnControl
15S3Printer ErrorStatus
16C2Initialize PrinterControl
17C3 (~)Select/Deselect PrinterControl
18–25Unused / Ground

In “Standard” mode, both the 8 data bits and the 4 control bits work as latched output pins. This means all 12 bits stay “on” or “off” until they are set differently — making very simple circuits for controlling lights.

The control bits are always two positions above the base address of the parallel port. For example, if your parallel port is at port 888 (0x378 hex) then the control address is at 890 (0x37A hex). This means pins 2–8 are controlled by setting the 8 bits on port 888, while pins 1, 14, 16, 17 are attached to the lower 4 bits on port 890.

To calculate what number to write, add up the values for each bit you want on:

Bit12345678
Value1248163264128

Examples:

The Design

My design consists of 40 8-circuit boxes for a total of 320 individually switchable circuits. It requires 6 writes (6 clock cycles) to change a single box (or 240 to change all boxes). Even a very slow Pentium 75 is able to change all 40 boxes in the blink of an eye.

The design for the main board only requires two types of integrated circuits: the 138 decoder and the 374 flip-flop.

The 374 Flip-Flop is really just a single chip with 8 bits of memory. There are eight “D” pins representing the input and 8 “Q” pins that are the output. The chip works by continuing to output on the “Q” pins whatever was present on the corresponding “D” pin when a clock signal was received (a clock signal occurs when pin 1 goes from Low to High).

The 138 Decoder takes the binary representation of 3 bits (zero = 000, 7 = 111) and sets the output pin that matches that value to Low. For example, if pins 1–3 are given 010, then pin 12 (Y3) will be set Low, and all other Y pins will be set to High.

How a Write Works

  1. The first data byte (8 bits) is put into a temporary 374 “memory buffer” representing which of 8 AC circuits should be on or off.
  2. The flip-flop control bit (pin 1) is set low (0V — inverted), latching the data in the flip-flop. This allows us to use the 8-bits on the parallel port to set routing information next.
  3. The flip-flop control bit is set back to high (+5V), resetting it for next time.
  4. Routing information is sent via the normal data channel. 3 bits go to all 138 decoders specifying the “column”, while 5 other bits only go to one decoder specifying the “row”. (8 columns × 5 rows = 40 different 374 “memory” chips, each storing 8 bits = 320 unique outputs.)
  5. The decoder control bit (pin 14) is set high to send a clock (Low) to the specific flip-flop box, locking the data.
  6. Finally, the destination flip-flop latches the data and turns on or off the lights via the 8-circuit boxes, holding its state until the next instruction changes it.

Photos

← Back to Technology