2001 2002 2003 2004-2007 2008-2009 2010 2011 2012 2013 2014 2015 2016

NOTE:The informaion on this page is rather old and never completed. Although this can technically still be build and used today, there are much better solutions now days. This page is kept for reference only. If you are looking inexpensive DYI AC solutions that also supports dimming, I suggest checking out the Renard set of solutions.

320 Parallel Port Controller


Please pardon the dust. This particular page is under construction. Much more description is being developed.



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. Luckly, I came accross Hill Robertson's design that can control up to 320 individual circuits. A modified it slightly, but it is really still the same design. (Note: If you need a much smaller number of circuits, check out my original design. These can always be convered to work with this design with little effort.)


The parallel port is a great way to interface the PC to external devices because (1) every PC has one, and (2) its easy to program. The parallel port has 8 output wires (OUTPUT), 5 input wires (STATUS), and 4 that are bi-directional (CONTROL).

Note: Today, most machines support different "modes" of the parallel port ("Standard", "Enhanced" (EPP), and "Extended" (ECP). Everything discussed here applys to "Standard" mode.

PIN NO. LABEL FUNCTION TYPE
1 C0 (~) STROBE CONTROL
2 D0 DATA BIT 0 OUTPUT
3 D1 DATA BIT 1 OUTPUT
4 D2 DATA BIT 2 OUTPUT
5 D3 DATA BIT 3 OUTPUT
6 D4 DATA BIT 4 OUTPUT
7 D5 DATA BIT 5 OUTPUT
8 D6 DATA BIT 6 OUTPUT
9 D7 DATA BIT 7 OUTPUT
10 S6 ACKNOWLEDGE STATUS
11 S7 (~) BUSY STATUS
12 S5 PE: PAPER TRAY EMPTY STATUS
13 S4 PRINTER ON-LINE STATUS
14 C1 (~) AUTO LINEFEED AFTER (CR) CARRIAGE RETURN CONTROL
15 S3 PRINTER ERROR STATUS
16 C2 INITIALIZE PRINTER CONTROL
17 C3 (~) SELECT/DESELECT PRINTER CONTROL
18-25   UNUSED/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 which makes very simple circuits for controlling our lights. The control bits are a little bit more complicated than the data bits since three of them are inverted. This means that if you want the signal to go high (+5V), you must send a zero (0V) to the bit and it will automatically be inverted (notted) and output a 1 (+5V).

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 pin 1, 14, 16, 17 are attached to the lower 4 bits on port 890.

Each bit in a byte is assigned a number. To figure out what number to set a byte to, you just add up the numbers of each bit you want on:
Bit #1 = 1
Bit #2 = 2
Bit #3 = 4
Bit #4 = 8
Bit #5 = 16
Bit #6 = 32
Bit #7 = 64
Bit #8 = 128

Example:
Bits 1 and 2 ==> 1 + 2 = 3
Bits 2, 4, and 6 ==> 2 + 8 + 32 ==> 42


My current design works exactly like Hill's. It 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 a 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 that represent the input, and 8 "Q" pins that are the output. The chip works by continuing to put out on the "Q" pins what ever was present on the coropsonding "D" pin when a clock signal was received. (A clock signal occurs when pin 1 goes from Low to High).

The pupose of a 138 decoder is to take the binary representation of 3 bits(zero = 000, 7 = 111) and set 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 (the default).

The way it works is as follows. The 374 chips are basically "memory" in the board for which circuits are turned on, and then we use the 138 decoder to "direct" which block of memory gets updated. The picture to the write (shamefully stollen from ComputerChristmas.com, while the site was still funcitonal) shows an annimgation of the different steps and how things are wired together.
  1. The first data byte (8 bits) is put into a tempory 374 "memory buffer". Each bit represents one of 8 differnt AC circutis as to wether it should be on or off. The 8 bits are all for one of the control boxes (since we write each box as one unit).
  2. The next step is to set that control bit (pin 1) is set low (0V) which is inverted. This latches the data in the flip flop and is stored (like memory). This will allow us to use the 8-bits on the parallel port to set routing information and not keep the data we wish to write stored "in memory".
  3. The flip flop control bit is set back to high (+5V). THis is because the data is actually stored in the flip flop on the swich form high to low, so we need to reset it for next time.
  4. Routing information is sent via the normal data channel. 3 of the bits to to all 138 decoders, but the other 5 actually only go to one of the decoders. I think of the 5 as which "row" of 374 chips to write to, while the three bits specify which of the 8 " columns" of 374 chips we sholud actually update. (8*5 = 40 different 374 "memory" chips. and since each chip stores 8 bits for 8 differnt outputs, the 8*40 = 320 unique outputs that can be controlled.
  5. The decoder control bit (pin 14) is set high to send out a clock (low) to the specific box flip flop. This locks the data in the 138 so that the the data from the original 374 "buffer chip flows will be locked into the correct final 374 "memory" chip.
  6. Finally, the destination flip flop latches the data and turns on or off the lights via the 8 circuit boxes and holds it's state until the next instruction is sent to change it.



Behind the Scenes

2002_board1.jpg 2002_board2.jpg 2002_board_3.jpg 2002_box_1.jpg 2002_box_2.jpg 2002_box_3.jpg 2002_computer_1.jpg 2002_computer_2.jpg 2002_computer_3.jpg 2002_computer_4.jpg 2002_connector.jpg wire_connectors.jpg wires_2.jpg 2002_wires_1.jpg box_closed_1.jpg box_closed_2.jpg box_closed_3.jpg box_open_1.jpg box_open_2.jpg

Source Code

The following source code controlled this year's display from a P-75 running the FreeBSD 4.7 OS.


Makefile
Main.c
2002.h
320controller.h
320controller.c
bushes.c
sign.c
snowmen.c



Powered by PHP         Powered by FreeBSD


Greg & Mary Hormann
ghormann@gmail.com
http://www.thehormanns.net
Copyright © 2000-2017
All Rights Reserved


IP: 50.116.60.82