320 Parallel Port Controller






2001 2002 2003 2004-2007 2008-2010

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).


More to come!



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@alumni.indiana.edu
http://www.thehormanns.net
Copyright © 2000-2010
All Rights Reserved