![]() | Please pardon the dust. This particular page is under construction. Much more description is being developed. |
![]() |
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.
|
![]() ![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 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.
|
![]() |
Makefile Main.c 2002.h 320controller.h |
320controller.c bushes.c sign.c snowmen.c |
![]() |
![]() |
|
|
Greg & Mary Hormann ghormann@gmail.com http://www.thehormanns.net |
Copyright © 2000-2022 All Rights Reserved |
|
|