Standard LPT port preserve 8-bits DP port and usually bidirectional for the lates product, 4-bits output PC port, and 5-bits input PS port. All of this I/O ports seem to restricted for our purpose use to design some gadgets. Here I already implemented the versatile LPT I/O expander card, to expand the functional I/O, easy to use and preserve many possible combination ever choosen. The card used a very popular IC ie. Programmable Peripheral Interface PPI-8255. Note that 82C55 is the CMOS type of PPI-8255 and newer version. All specific characteristic mostly the same accept that, 82C55 allow read back the CW. This IC have 3 general ports (Port-A, Port-B, Port-C) and the ports can be programmed to be input ports or output ports and bidirectional port. There are 3 operation mode for these ports. Mode-1, the port will be programmed to be a simple input or output port. Mode-2, the port will be programmed to be a hand-shaking input or output port, and for mode-2, the port will be programmed to be a full handshaking (bidirectional port). Each port can be programmed. Port-A support mode-0 to mode-2, port-B only for mode-0 and mode-1, and port-C only for mode-0 and this port has the ability to be programmed as a one bit set/reset port if port-A or port-B (or both) used for mode-1 or mode-2. Because some bits of port-C used for control signals to the 2 ports. Some bits that are not used can be programmed for bits set/reset port. You see, many possible combination ever made, by these combination. That's all folks, lets we face of the circuit and schematic.

click the below images  for zooming

Fig.5. LPT port expander schematic diagram.
For controlling the functional signals of PPI-8255, as usual DP port used for data interchange (LPT port must have bidirectional capabilities for this purpose), PS port not used (spare), PC port used all for supporting the activated of PPI-8255 signals. Because this IC has 6 functional signals, while PC only preserve 4-bits, so we must make a tricky circuit to accomodate the operational. Fortunately these 4-bits PC meet our purpose. Tabel-2. Shows the operational function of PPI-8255.
A1 A0 RD WR Reset CS Description
X X X X 0 1  DP side is tri-state (Hi-Z)
X X X X 1 X  All ports as input ports (reset)
0 0 1 0 0 0  DP side to port-A (write port-A)
0 1 0 1 0 0  Port-B to DP side (read port-B)
1 0 1 0 0 0  DP side to port-C (write port-C)
1 1 1 0 0 0  DP side to port-CW (write port-CW)
1 1 0 1 0 0  Not allowed for 8255A-5, but accepted for 82C55 type
 (read port-CW)
Tabel 2. Control function of PPI-8255.

I already selected the PC bits to these signals (infact that these PC-bits free to used for, but the software must be co-related, if you don't want to be bother of, just follow on). PC-5 bit as usual used for bidirectional enable (this is standard LPT port function), PC-3 bit used for WR signal (note that PC-3 is inverting input), PC-2 bit used for RD signal (this is normal input), While PC-1 and PC-0 used for addressing port (to make the simplicity). PC-1 bit used for selecting address A1 (note that PC-1 is inverting input) and PC-0 used for selecting address A0 (this also an inverting input). The others functions, reset and Chip Select (CS) enable by used the combination of PC-3 and PC-2 bits using gate combination. Tabel-3. Shows this combination bits to meet the operation of PPI-8255 (like tabel-2) .
DP-7 ~ DP-0 8-bit bidirectional 
data port
PC-5 (Bidirectional Enable) PC-4
(IRQ Enable)
PC-3 (Inv.)
Used for WR
Used for RD
PC-1 (Inv.)
Used for A1
PC-0 (Inv.)
Used for A0
Control port
X X 0 0 0 1 X X Stand-by mode (Hi-Z)
X X 0 0 1 0 X X Reset
X X 0 0 1 1 1 1 Writing port-A
X X 1 0 0 0 1 0 Reading port-B
X X 0 0 1 1 0 1 Writing port-C
X X 0 0 1 1 0 0
Writing port-CW
Reading port-CW
(not allowed for 8255A-5 but accepted for 82C55 type)
Tabel-3. Implementation of PC-signals for control function of PPI-8255.

One of the PCB design layout shown in fig.6. This also using a single side PCB, so it has a lot of jumper wire. You can make another design if you want, but this one works well (my prototype). 

Fig.6. LPT port expander PCB layout.

Parts List :
    IC's :
      Programmable Peripheral Interface PPI-8255 family ...................... 1 pcs
      Hex inverter (74LS04) .................................................. 1 pcs
      Quad AND gates (74LS08) ................................................ 1 pcs
    Capacitors :
      220 uF/16V ............................................................. 1 pcs
      100 nF (for IC decoupling - optional) .................................. 3 pcs
    Others :
      DB-25 Socket female .................................................... 1 pcs
      Connector 10-pin (sip) ................................................. 3 pairs
Before using the card, the PPI-8255 must be reset first, and then initialized by given the correct Control Word configuration. Because many possible combination mode ever happened to this card so it is quiet difficult to show how to programming this card. Here I only show the combination mode-0 for all of the ports. If you already have built the project of 36-bits led display driver, you can put it to the output port-A through port-C. A sample in assembly program show the demo for the possible combination of mode-0. Here is the sample in pascal program shows the combination of port-A and port-C as output port and port-B as input port, all operate in mode-0. I used this combination in IC tester program. 
    LPT_Port       = (LPT_1, LPT_2, LPT_3, No_LPT);
    Mode_PPI       = (Port_A, Port_B, Port_C, Port_CW, Port_Hi_Z, PPI_Rst);
     PC_Port       : ARRAY[0..2] OF WORD =
                     ($03F8,$02F8,$0278);   { 'COM1','COM2','LPT1' }
     DP : ARRAY[LPT_Port] OF WORD = ($3BC, $378, $278, $3BC); { Data Port }
     PS : ARRAY[LPT_Port] OF WORD = ($3BD, $379, $279, $3BD); { Status Port }
     PC : ARRAY[LPT_Port] OF WORD = ($3BE, $37A, $27A, $3BE); { Control Port }
     Port_PPI : ARRAY[Mode_PPI] OF WORD = ($000F,     { Port-A PPI as output port}
                                           $0022,     { Port-B PPI as input port}
                                           $000D,     { Port-C PPI as output port}
                                           $000C,     { Port-CW PPI as output port}
                                           $0004,     { Port-Hi-Z PPI }
                                           $0008);    { Reset PPI }
     Port_A_PPI    = $03;    { Note that Port-A through Port-CW }
     Port_B_PPI    = $02;    { are inverting to PC-0 and PC-1 }
     Port_C_PPI    = $01;
     Port_CW_PPI   = $00;
PROCEDURE Inisialisasi_PPI;
     PORT[PC[LPT]] := Port_PPI[PPI_Rst];    { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[PPI_Rst];    { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_CW_PPI;
     PORT[DP[LPT]] := Set_Mode_PPI;
     PORT[PC[LPT]] := Port_PPI[Port_CW];    { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_CW_PPI;
     PORT[DP[LPT]] := Set_Dec_Port_C[Steady_State];
     PORT[PC[LPT]] := Port_PPI[Port_C];     { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_C_PPI;

PROCEDURE Write_Port_A(Datanya : BYTE);
     PORT[DP[LPT]] := Datanya;
     PORT[PC[LPT]] := Port_PPI[Port_A];     { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_A_PPI;

PROCEDURE Write_Port_C(Datanya : BYTE);
     PORT[DP[LPT]] := Datanya;
     PORT[PC[LPT]] := Port_PPI[Port_C];     { Give a pulse }
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_C_PPI;

   Temp : BYTE;
     PORT[PC[LPT]] := Port_PPI[Port_B];     { Give a pulse }
     Temp := PORT[DP[LPT]];
     PORT[PC[LPT]] := Port_PPI[Port_Hi_Z]+Port_B_PPI;
     Baca_Port_B := Temp;
PCB Mounting. I put my prototype on a piece of board like showing in the fig-7. But all of this depends of your design idea. I prefer to place all of it on the board and not in the box, because it will be more easy to make some test to the circuit or to make some measuring voltages or logics. 

Fig.7. LPT port expander prototype card.

My prototype used a simple regulated power supply from 7805 IC regulator. The complete circuit and layout are shown in fig-8. and the parts list are as follow :
Additional Parts List :
    IC's :
      Voltage Regulator 7805 ................................................. 1 pcs
    Capacitors :
      1000 uF/16V ............................................................ 1 pcs
      470 uF/25V ............................................................. 1 pcs
    Others :
      Diode 1N4007 or Brigde diode ........................................... 4 pcs
      On/Off Switch .......................................................... 1 pcs
      Transformer p=220V/s=9V, 100mA ......................................... 1 pcs
      Indicator Lamp 5V ...................................................... 1 pcs
      Fig.8. LPT expander card power supply schematic diagram and PCB layout.
Fig-9. Shows the application for 36-bit leds display driver run the card in mode-0. You can make some experiment for another mode or combination of them by yourself. 
Fig-9. LPT Expander card application, running the 36-bit leds display driver in mode-0.
 Last word for expander circuit, this idea comes from the reader, Eugene Lisovy (4RESTER), instead of using two chip for decoding reset and cs signal for PPI using 74LS04 & 74LS08 (we just used only half each), better used one chip, ie.: CD4555 (Dual Decoder/Demultiplexer 1 to 4 channels), it has the same function. Schematic diagram for this chip function is here. Thank's very much Eugene!!! for your excellent suggestion!

Here is the LPT expander modification version he suggested :

Experiment is the best teaching for us to learn. For some people, this is true. A reader above, still searched the capabilities of this expander circuits. He didn't stop to dig the flexibility to run it. I think that his idea must be consider, because it will bring to the new improvement. Besides that, may be his idea is useful for another people too. Here is his experiments :
Now I'm working with project, embedded system, using PC-main board with integrated Video Card & Sound Card. I'm using schematic of LPT PORT EXPANDER, with decoding of LPT->8255 on CD4555. But! For me very important, to 8255 will be RESETED after cold & warm reset! After some experiments I finded easy way!
Looking to attached schematic diagram, that's based on my modification, who I already sent to you a long time ago. But now we have:
  1. all function of control of 8255 is also available
  2. after cold & warm reboot 8255 stable reseted & still in reset state up to OS (Windows also!) will be total launched!
Looking to 1st table in attached schematic diagram. Here I'm descript state of LPT's pins 1,14,16,17 in different levels of restarting (cold & warm is same) computers. As You can see: immediately after rebooting pins 1 & 14 set to HIGH("1") & still unchanged up to total launching windows, & still HIGH up to any Windows software change it. But PINs 16 & 17 is very unstable! Because Windows use this PINs to detect Plug&Play devices on LPT (like LPT_Printer, LPT_Scanner, LPT_to_IDE, e.t.c).
Now we know, good idea use condition: LPT_PIN_1="HIGH" + LPT_PIN_14="HIGH" as reset for LPT_PORT_EXPANDER, based on 8255. Command combination described in 2nd table in attached schematic diagram.

Thank you very much to this reader for the new improvement. Note that, by using his design, all the program must be change also, to support the new command order, and it's not compatible to all of my existing program.

1 comment:


PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts