How to Control Christmas Lights - How to do almost anything with Christmas Displays.
  September 30, 2014 - Tuesday |Id: Visitor|Login|Prefs|Register| 85 more shopping days until Christmas  
Home
About Us
Story
Forum
Forum Pro
How To
Photos
Videos
Classifieds
Community
Score Board

High Scorer
Hill Robertson
Featured Pics
Featured HowTo
Curtain Strobe Modification







HowTo: How To Build A Parallel Port Controller Box  (Hill Robertson)


                    Page 1   Page 2    Page 3    Page 4       Next Page >>

Step 1 : The Standard Parallel Port


To build a parallel port control box we must first understand how the PC's parallel port works. In this How To we will only discuss the Standard Parallel Port. There are also Enhanced Parallel Port (EPP) and Extended Capability Port (ECP) modes on newer ports. If you have a newer parallel port that can be set to specific modes, be sure to set it to Standard mode when following this How To.

There are several pins that are very important to us to control our Christmas lights (or anything else). Most people focus on the 8 data pins and suggest that you can only control 8 circuits with each parallel port for a total of 24 circuits if you max out your PC with three ports. This is only partially true. For the simple schematic, 8 is about all you can do from the data bits without using multi-write hardware/software. However, we do still have 4 control bits we can use as well. These bits can be used the same as the data bits for a total of 12 circuits for each port. All 12 of these bits are latched. This means they 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). You are also using a slightly different base address to access the control bits. The parallel port base address for the first port is typically 0x378 (in hex) and the control address is base+2. Still, in the scheme of things, it is still pretty easy and you gain 50 percent more circuits! So, you can have 36 total circuits with three parallel ports and no additional hardware. This is still a bit limited and we are going to look at a multi-write solution to have MANY circuits controlled from one parallel port with a little bit of hardware added.

Here we go.....

Step 2 : Design

My main goal was to have a small box that would easily control many Christmas light circuits from one parallel port. I specifically wanted to use the parallel port so I could easily plug it into any PC. I did not want to have to open up PC cases and remove boards every time I wanted to use a different PC. I also did not want to pay $400 for a 192 output digital IO board and cables when I could make something to handle more circuits for less money. The box needed to be expandable with the addition of a little more hardware. Lastly, I wanted to prove to myself that I could do it.

So I did.

My design was very simple using only Flip Flop and Decoder chips. It uses a "six write" technique for each operation. This means that to turn a circuit on or off required a minimum of 6 clock cycles worth of data to the parallel port. These six writes are performed almost instantaneously for even the slowest PC and are not detectable with the human eye. Even if the circuit was expanded to over a thousand circuits it would not be noticable. In this schematic, 320 circuits can be controlled. Each 8 port circuit box has one 8-bit (byte) flip flop associated with it to latch (or hold) the data. Eight of the 8-bit ICs makes up one bank for a total of 64 bits. Each one of these 64 bit banks is controlled by one 3 to 8 decoder which clocks the enable pin on the requested flip flop IC in the bank. There are five banks for a total of 320 bits (8x8x5=320).

All 320 bits can change states in 240 writes (6 Writes x 40 (bytes) = 240 Writes). Again, this is way too fast for the eye to notice.

Step 3 : IC Specifications

There are only two types of integrated circuit chips in this schematic. They are 138 decoders and 374 flip flops. The flip flops are for data storage (like memory) and the decoders are for addressing (actually, more like steering).

Step 4 : The 138 Decoders


The decoders basically convert a 3 bit control to a 8 position switch (3x8 decoder). This "turns on" one of the 8 chips in the bank to accept the data for that box.

For example, if we want pin 14 to go low (notice that it is notted or inverted), we must send a binary "2" to the A0, A1, and A2 inputs. The binary code for 2 is 010. So, pin 1 must be low (0), pin 2 must be high (1) and pin 3 must be low (0). Then, once a chip enable is received (via the combination of pins 4, 5, and 6), pin 14 goes low (0) and pins 7,9,10,11,12,13, and 15 go high. (See truth table for more information)

Here is the pinout diagram for the decoder.

Step 5 : 138 Truth Table


Here is the truth table for the 138 decoder.



                    Page 1   Page 2    Page 3    Page 4       Next Page >>
 

 
Designed, Hosted, and Coded by Hill Robertson
Computer Christmas - Copyright 2001 Hill Robertson