Home Products Prices Site Map Order Contact What's New Books Free Files Links FAQ
Dontronics Home Page Parallel Interface.
Bottom of Page

Sorry, sold out 8-May-2004
 


DT002 (Formerly PIPEX or PPEX).
Disclaimer:

Here is a kit product that was designed some time ago when DOS was Boss, and 286's ruled the earth. We are finding that users are starting to have problems with newer machines and windows, so we are reducing the price to $20AUD for the printed circuit board. Check Dontronics Dealers for local supplies. There is no off the shelf software that will run this kit under Windows, and there is no guarantee that it will run on fast machines.

WWW Deal 2: DT002. Two for $20AUD Parallel Printer Port driven. This is a PCB that has provision for 32 bits out, 32 bits in. Free Air Mail postage world wide. You get the blank PCB, the overlay and circuit. You must get all your files from my home page.
 

Here is a project done with PIPEX: Robot Piano by Richard Pell

The Table of Contents.

Free Local And International Air Mail Postage. on Printed Circuit Boards. Conditions Apply.
What is PIPEX or PPEX?
PPEX Assembly Instructions:
Read Write Documentation:
Basic Read Drivers:
Basic Write Drivers:
Basic Combination Read/Write Drivers:
PC Assembly Code:
Full Working files:
PDF files for the Schematic and Overlay.

What is PIPEX?

Please Note ***** If a value is given as 4K7, this is 4.7K, or four thousand, seven hundred ohms.

 This is an Electronics DIY project which allows your PC printer port to control 64 bits of the outside world.

 PIPEX is a device that connects to the standard Centronics parallel printer port of a computer system to produce an I/O system for control purposes. It has 32 output bits, and 32 input bits. Multiple boards can be cascaded together to produce virtually an unlimited number of I/O bits.


View DT002 PCB overlay

Printer port bits used are D0, D1, D2, D3, D4, D5, and Ack. All of these signals are buffered with a 74LS244. A Power LED, Read LED, and Write LED are provided, also +5 Volts and ground test points.

 One of four 74LS165's is used to read in 8 bits of data via the ACK signal. One of four 74LS164's is used to convert a serial data stream on the D0 signal line to 8 output bits.

 Four 74LS373's blank the load ripple of the 164s and can be individually jumper configured (J1-J4) to be software controlled tri-state output. Board default is output always enabled.

 Cheap DB-25 solder tail connectors are used to connect boards together. A standard DB-25 male to DB-25 female cable is used to connect between the PIPEX board and your computer system printer port.

 Resistor Networks RN1-RN4 (4K7) are optional and used to pull the input lines to a known (High) state.

 All 34 pin Input and Output male header pinouts are the same. This enables you to easily do a loop back test on any section using a 34 wire flat ribbon cable with two 34 pin IDC female crimped connectors attached. Each header has 16 data signals, 16 grounds, and two +5 Volts.

 You only need to build up the section(s) of the board that you require. If you only need input lines, then you only install the 74LS165(s). You will always have to install the 74LS244 and 74LS04.

 A small power supply section is included on the board. This consists of an input diode bridge, 7805 (+5V) regulator, and filter Capacitor. This allows you to use any input voltage from about 9 Volts to 12 Volts AC or DC.

 "SUGGESTED" POSSIBLE USES: I.C. Tester, Eprom Burner, Eprom Emulator, Automotive Loom tester, Bed O' Nails PCB Tester, Static Micro-Controller Emulation, Drive LED and Flip Vane Indicators, Complex Video (Audio) Switching, Robot Control, Foot Pedal Alarm Sensing, and Relay Switching.

 In fact, any operation that requires a large number of inputs and/or outputs can be controlled from a standard computer system with my PIPEX board.

 Many example programs are included with this package. One of these is an EPROM reader program. NO, not a 'writer'. That would need burning voltages. The reader will read the following devices:
2764, 27128, 27256, 27512, and 27010. (128K by 8)
Plus these SRAMs: 6264, 62256, and 68100. (128K by 8). 


The PIPEX short form kit consists of the printed circuit board, and full documentation. Software driver examples are given in 8088 & Z80 Machine Code, and Basic. A detailed programming flow chart is provided to enable you to program the PIPEX in YOUR favorite language.

 The PIPEX board measures 2" by 6", is double sided, plated through, and solder masked.

 Advertised Price Includes Return AirMail Postage, Circuit and Overlay.
Back to The Table of Contents.

PPEX Assembly Instructions:

Four early warnings:
(1) The I.C.'s on my boards are tightly packed. If you choose to use sockets, make sure that your sockets fit into the board before soldering them in. Chunky sockets will not match up with the .1 inch centres between chips.

 (2) The PPEX board is easily ruined by soldering the components onto the board the wrong way. The solder side is marked. The header pins, capacitors and resistors mount on the component side. The DB25 connectors will only mate with the edge connector one way. Check the overlay, and double check male/female orientation.

 (3) Before and during assembly, test for ground to +5volt shorts. These two tracks run from one end of the board to the other, and are the hardest shorts to find after all I.C.'s have been installed.

 (4) Today, (30-Apr-93) I tested my PPEX software on a new real PS/2 IBM Notebook and it didn't run. Found the trouble was the byte written to LPT1: Base Address+2, or 3BEHex in my case. After power up this byte reads ECHex. You can use Debug to read and write this byte if you wish. Commands O 3BE,EC and I 3BE can be used. This power-up byte is the same for IBM and clone computers. On an IBM this byte must be CCHex or bit 5 cleared. An O 3BE,CC from debug will fudge existing software.

 I have now fixed this bug and any software written after today will reflect these changes. Upon exit, ECHex should be restored to port LPT1: Base+2 Address. 


Items supplied in kit:-
The PPEX short form kit consists of the printed circuit board, and full documentation. Software driver examples are given in Z80 Machine Code, 8088 Machine Code, and Turbo Basic. The full source code is included. A detailed programming flow chart is provided to enable you to program the PPEX in YOUR favorite language. The PPEXSEQ program and other MS-DOS (8088) programs will be available on this disk.

 The kit builder should have a reasonable tool kit which will include a Multi-Meter. A logic probe may be needed to help you with any hardware problems that you could run into. The logic probe I use is a 3800A. It is available at most electronic outlets for around $35.00 Don't rush out and buy a logic probe because I said you may need one, you probably won't, but if you do run into real strife then it may be the only way out.

 The following items are needed to complete the project:- I have broken this into Section A, and Section B. Section A items are needed only if you don't have an existing +5 volt power supply. 


SECTION A. (Power components.)
Plug-pack 9 volts AC or DC at 300-500mA or greater. The current required will vary depending on the number of I.C.'s that you install on each board. A fully populated board requires around 500ma. If you are running add on boards such as relay driver boards, you may need 1 Amp or more. See more on power requirements and power savings below.

 Experienced builders may prefer to use a suitable AC transformer. (DSE Cat M-2155 multi-tap @ 1A. Set at 7.5VAC tapping.)

 You can of course steal +5 Volts from an existing PC power supply. This could be done with an extended disk drive power cable, or a 5 pin din keyboard intercept cable. This will provide +5 Volts. If you are running a Laptop or Notebook, you will probably need an external plugpack.
 
 

Diode Bridge D1 WO2 or WO4 type.  (DSE Cat Z-3304)
Capacitor    C1 1000uf Electrolytic @16 Volts. (PCB type mount.)
Capacitor    C2 10uf Tantalum @16 Volts.
7805         +5 Volt regulator in TO-220 case.
Heatsink     A suitable heatsink for the 7805 is required if you draw about
             400ma or more.

NOTE *** Power requirements will be greatly reduced if you use "HC" instead of "LS" devices. Of course, these are usually more expensive, however this is now changing. 
Section B.          (Main board components.)
Capacitors  BC1-BC10 .01uf Ceramic (10) (bypass)
Resistor    R1 270 OHMS
Resistor    R2 270 OHMS
Resistor    R3 1K
Resistor    R4 1K
Resistor    R5 270 OHMS

4 by Resistor Network SIP package, 9 x 4K7 resistors with one common
pin. (10 pin device)     *****   OPTIONAL, NOT NEEDED ON BASIC SWITCH
                         *****   SENSING TO GROUND.

E1              1 by 74LS244          (or 74HC244)
E2              1 by 74LS04           (or 74HC04)
E3,E6,E9,E12    4 BY 74LS165          (or 74HC165)
E4,E7,E10,E13   4 by 74LS164          (or 74HC164)
E5,E8,E11,E14   4 by 74LS373          (or 74HC373)
3 by 5mm LED's. Red for Read, Green for Write, and a nice Orange for Power.

 4 by 34 pin dual row male header pins. These may come in various lengths, but can be easily cut down or added to for length.

 Some single row pins may be needed for J1-J4. (Only used for tri-state outputs.)

 Chip sockets:-
Not needed. But for experimenters or Novices it may pay to fit sockets to all locations. This will help to trouble shoot if you strike problems.

 One DB25 Male solder tail connector, and if you wish to cascade to another board, one DB25 Female solder tail connector. 


NOTE **** For simplicity, the circuit shows only one section of four identical sections of the PPEX board. This should be self explanatory. 
YES, ANOTHER NOTE **** If you don't need to blank the output load ripple, and don't need to be able to tri-state the outputs, you can reduce costs and power requirements greatly by not installing the 74LS373's.

 The best method of doing this is to install sockets for the 373 positions, and jumper the inputs to the outputs at the socket pins as follows: Pins 2 to 3, 4 to 5, 6 to 7, 8 to 9, 12 to 13, 14 to 15, 16 to 17, and 18 to 19.

 By using this method, if you change your mind later on, you can easily remove the 4 sets of 8 links and install the chips. 


THE REAL ASSEMBLY:

 You will need to use a file to bevel a slight 45 degree angle along the DB-25 connector tracks so that the DB-25 connectors will push hard onto the board without damage. Don't solder them on yet, these will be almost the last item installed. Just make sure you man handle the board with the file before any other assembly.

 This board is really simple to assemble. There are no real traps or secrets, so I won't spend time teaching Novices how to kit build and solder here.

 Install all I.C.'s, or I.C. sockets to suit. Take note of the pin 1 location.

 Install all resistors. 


Install C2. Note that the "+" end is near the DB-25 connector. Some early overlays that I distributed had the "+" end drawn near E1. This is not correct. My mistake... 
Install the 3 LED's. Looking at the board overlay, the cathode end of the LED's are at the bottom, towards the input headers. The LED's cathodes are found in one of three ways.

 (1) The Cathode leg is shorter than the Anode.
(2) A flat edge will be found next to the Cathode.
(3) Reverse it if it doesn't work. (Not the prescribed method.)

 Install the four 34 pin headers.

 Don't worry about J1-J4 headers at this stage. The outputs of the 74LS373's are enabled at all times. These headers are included in the design so that a tri-state data bus may be able to be used on future projects such as EPROM burners and emulators. 


If you aren't stealing +5V power from a PC or other source, you will need to build up the power supply section of this board as mentioned below.

 (It is easier to install the DB-25 Male connector before you install the following components:)

 Install C1, D1, and the 7805 regulator. If required, install the heatsink. 


Install a DB-25 Male connector to the input end of the board as shown on the overlay. Do the same with a female connector on the output end if cascading boards.

 Connect up your plug pack, transformer, or PC power supply to the PPEX board for final testing.

 You may wish to solder some pins into either of the two points marked +5V and GND so that you can hook up a meter or logic probe. These +5 Volt points can also be used to jumper +5V power to cascaded boards.

 Upon complete assembly, power the unit up, and check for +5 volts to the board. Check all I.C.'s to make sure there is no excessive heat. 


If satisfied, power down and connect the unit to your computers parallel printer port using a DB25 Male to DB25 Female cable. This cable must have the full 25 pins connected straight through.

 If you live in Melbourne, try the Malvern Town Hall on the first Sunday of the month, or the Moonee Ponds Town Hall on the last Sunday of the month for an unreal price on these types of cables. 


Testing to a Computer....
Make up two 34 pin header jumper cables using a couple of short lengths of 34 wire flat ribbon cable and four 34 pin female IDC crimp connectors. For my prototyping, I made my cables about 9" long.

 I have always used an old vice to crimp my IDC connectors to the flat ribbon cable. This works well.

 With your two new jumper cables, jumper input header 1 to output header 1, and input header 2 to output header 2.

 Using your MS-DOS computer, run the program "PPEXLOOP". On power up, the read and write LED will alternatively flash four times each. If all is well, the input bit will always follow the output bit. You can try crossing over the two jumper cables if you like, or if you have a hardware problem, and need to section isolate.

Copy "CROSSEYE.NET" to "SEQ.NET" and run "PPEXSEQ". This will also prove your board with the jumper cables attached. Watch the read and write LED activity as you alter the speed setting. Set the speed to 1 and use the insert/delete keys to greatly reduce and increase LED brightness.

 Remove your jumper cables and run "PPEXASM". You will need an LED monitor circuit or logic probe to "SEE" the output levels change. A test link or shorting lead can be used to ground each bit of the input.

 NOTE *** Don't accidentally short out ground and +5V on the Input headers.

 Even without the resistor network, all input bits will be read as highs without any test links connected.

 The Binary, Hex, and Decimal values of the input bits will be shown with the "PPEXASM" and "PPEXBAS" programs.

 If your board passes all of the above tests, the rest is up to you. You must now write the software for YOUR application.

 I would appreciate any feedback, and particularly feedback in the form of PPEX drivers in popular languages (or computer systems) that I haven't covered. (IBM MS-DOS disk format please.)

 These is no reason why this board can't be used on any computer system that has a parallel printer port. In fact, I have already written a Z80 machine language driver for the AMSTRAD NOTEPAD NC-100 computer. 


Going Further.

 My PPEXSEQ program can be used with User generated Netlists for a multitude of tasks.

 A Netlist has all the information required to run a programmed sequence of output events.

 Any number of groups of 64 bit changes can be output, and this sequence of events can be repeated from 1 to 65535 times, or set in an endless loop. 


CABLE ADAPTION.
As you find new uses for the PPEX board, you will come up against the problem of different header and connector pinouts.

 The way that I overcome this problem is to use flat ribbon cable, IDC crimp connectors, some male header pins, and a small section of matrix board that has solder pads on one side. (See Mr TANDY).

 Solder a 34 pin header into the board. This will mate up with the PPEX headers. If you wish to adapt to say a DB25 connector, solder a 26 pin male header onto the board. Crimp the female headers and a DB-25 connector to your cables and plug the cables onto the board.

 You are now in a position to "BUZZ" the pins before proceeding. Make your cross connections with insulated wiring. When completed and fully tested, you can either tape the whole thing up, or make up a box frame from cardboard that fits snugly around the matrix board.

 This can then be filled with epoxy resin (or similar), and then painted when set if you wish. You will now have a very robust "CORRECT" adapter cable for that special job.

 Back to The Table of Contents.

Basic Drivers Documentation:

The files PPEX_RD.BAS and PPEX_WR.BAS are simplistic forms of the PPEX read and write drivers.

 PPEX_RD.BAS

 The read version uses the first 8 input pins of the PPEX board. These are the ones that are closest to the input DB-25. The appropriate 4K7 resistor pack should be installed to read these pins correctly.

 Test links (shunts) or a system of switches can be hooked up to the input header pins. If you use test links, these can be placed directly onto the header pins between each pin and its matching ground in order to pull the pin from high to low. An old screw-driver will also do the job.

 The PPEX_RD.BAS file is set up for 8 bits in only. The code to fetch more bits is included, however the input routines would have to be enlarged to reflect the increased input reads. I have kept this code to a minimum to simplify it. The more complex file "PPEXBAS.BAS" shows how to read in 64 bits, or 8 bytes. This is two PPEX boards.

 The program must read the very first bit on its own. This is followed by a 7 bit read to produce a full 8 bits or 1 byte. Additional reads are done on a full 8 bit or 1 byte basis. 


PPEX_WR.BAS

 The write version also uses the 8 outputs closest to the DB-25 input connector. A resistor and LED network can be wired up. Wire a 330 ohm resistor from the header pin to the anode of an LED. The cathode of the LED is connected to ground. A logic probe will also do nicely and save the bother of the resistor to LED wiring.

 A relay board could also be wired up as an LED monitor.

 Like the read routines, the number of output bits written can be increased easily. Read the "PPEXBAS.BAS" file for examples.

 After the bits have been output to the PPEX board, a single ripple blank routine must be called. This outputs the data to the LED's via the 74LS373's.

 Back to The Table of Contents.

Basic Drivers for Read only Routines:

10 REM PPEXRD.BAS by Don McKENZIE UPDATED 4-JUN-94(c)
20 REM THIS BASIC DEMO WILL READ 8 BITS IN USING A PPEX BOARD.
30 REM A SYSTEM OF SWITCHES OR LINKS SHOULD BE
40 REM HOOKED UP TO VIEW THE RESULTS. CHANGE THE VALUE "BYTESIN" TO
50 REM TO INCREASE THE TOTAL BITS TO READ. NOTE 8 BITS = 1 BYTE
60 REM IF YOU DO INCREASE THIS VALUE, OTHER CHANGES MUST BE DONE TO
70 REM REFLECT THESE CHANGES IN THIS DEMO PROGRAM. READ DOC FILE.
80 REM
90 CLS
100 GOSUB 1040:REM SET UP PRINTER PORT
110 BYTESIN=1:REM SET UP FOR 8 BITS. (8 BITS=1 BYTE)
120 DIM INDATA(BYTESIN-1):REM RESERVE MEMORY BYTES FOR DATA IN
130 DIM INBITS(8):REM TEMP STORAGE FOR 8 BITS READ IN
140 PRINT"PPEX DEMO PROGRAM TO READ 8 SWITCHES"
150 PRINT"PRESS ANY KEY TO EXIT THIS PROGRAM"
160 REM
170 REM *********************************************************
180 REM MAIN PROGRAM LOOP FOLLOWS                               *
190 REM *********************************************************
200 REM
210 LOCATE 8,1
220 REM EXIT THIS PROGRAM ON ANY KEYPRESS
230 A$=INKEY$:IF LEN(A$) <> 0 THEN GOTO 1840
240 REM *********************************************************
250 REM PPEX READ FOLLOWS                                       *
260 REM *********************************************************
270 REM
280 REM *********************************************************
290 GOSUB 1170:REM READ THE VERY FIRST BIT IN THE FIRST BYTE    *
300 REM *********************************************************
310 REM
320 REM *********************************************************
330 GOSUB 1350:REM (CLOCKIN) READ THE NEXT 7 BITS OF FIRST BYTE *
340 REM *********************************************************
350 REM
360 REM STORE FIRST RESULT (8 BITS) TO RAM POINTER INDATA(0)
370 INDATA(0)=A
380 REM
390 REM 1 FULL BYTE READ, IS THERE MORE?
400 REM *********************************************************
410 IF BYTESIN >1 THEN GOSUB 1530:REM READ ADDITIONAL BYTES IN  *
420 REM *********************************************************
430 REM
440 REM *********************************************************
450 REM END OF READ ROUTINE                                     *
460 REM *********************************************************
470 REM
480 REM *********************************************************
490 REM CONVERT 1 BYTE READ INTO 8 BITS                         *
500 REM *********************************************************
510 REM
520 INBITS(7)=INDATA(0) AND 128
530 INBITS(6)=INDATA(0) AND 64
540 INBITS(5)=INDATA(0) AND 32
550 INBITS(4)=INDATA(0) AND 16
560 INBITS(3)=INDATA(0) AND 8
570 INBITS(2)=INDATA(0) AND 4
580 INBITS(1)=INDATA(0) AND 2
590 INBITS(0)=INDATA(0) AND 1
600 REM
610 REM *********************************************************
620 REM GET FIRST 8 BITS AND WRITE RESULTS TO THE SCREEN        *
630 REM *********************************************************
640 REM
650 REM *********************************************************
660 REM FIRST, SHOW THE 8 SWITCH POSITIONS                      *
670 REM *********************************************************
680 REM
690 PRINT"SWITCH                       VALUE":PRINT
700 FOR X=7 TO 0 STEP-1
710 PRINT "SWITCH ";X;"IS ";
720 IF INBITS(X)=0 THEN PRINT"LOW ", ELSE PRINT "HIGH",
730 PRINT INBITS(X);"  "
740 NEXT X
750 REM *********************************************************
760 REM THEN THE HEX, DEC, AND BIN VALUES.                      *
770 REM *********************************************************
780 REM
790 PRINT
800 PRINT"HEX","DECIMAL","BINARY"
810 A$= HEX$(INDATA(0)):IF LEN (A$) = 1 THEN A$ = "0" + A$
820 PRINT A$,'    ";
830 PRINT INDATA(O),'       ";
840 REM GWBASIC BIN$ ERROR IS TRAPPED BELOW
850 ON ERROR GOTO 1000
860 A$= BIN$(INDATA(0))
870 IF LEN (A$) <>8 THEN A$ = "0" + A$:GOTO 870
880 PRINT A$;
890 REM
900 REM *********************************************************
910 REM FINISHED, DO IT ALL AGAIN.                              *
920 REM *********************************************************
930 REM
940 GOTO 210
950 REM
960 REM *********************************************************
970 REM GWBASIC BIN$ ERROR TRAP FOLLOWS                         *
980 REM *********************************************************
990 REM
1000 PRINT:PRINT
1010 PRINT "Binary $trings Not supported on this version of Basic."
1020 RESUME 210
1030 REM
1040 REM *********************************************************
1050 REM PRINTER PORT SET UP. DONE ONCE...                       *
1060 REM *********************************************************
1070 REM GET LPT1: FROM BIOS
1080 DEF SEG=0:X=PEEK(&H408):Y=PEEK(&H409):P=X+(Y*256)
1090 REM SET DATA OUT AND DATA IN PORTS
1100 PRTPORT=P:ACKIN=PRTPORT+1:
1110 LOCATE 1,1: PRINT "PRINTER PORT USED IS ";HEX$(PRTPORT)
1120 REM SET DATA PORT+2 TO &HCC. (NEEDED FOR PS/2 COMPAT.)
1130 REM ON PROGRAM EXIT, IT SHOULD BE SET BACK TO &HEC
1140 OUT(PRTPORT+2),&HCC
1150 RETURN
1160 REM
1170 REM *********************************************************
1180 REM THIS ROUTINE READS THE VERY FIRST BIT IN THE FIRST BYTE *
1190 REM *********************************************************
1200 REM
1210 REM CLEAR TEMP BYTE STORAGE
1220 A=0
1230 REM INLOAD: SET D4 LOW. ALL OTHER BITS HIGH. OUT TO PRTPORT
1240 OUT(PRTPORT),&HEF
1250 REM ALL BITS HIGH. OUT TO PRTPORT
1260 OUT(PRTPORT),&HFF
1270 REM READ ACK SIGNAL
1280 D=INP(ACKIN)
1290 REM MASK RESULT TO 1 BIT
1300 D=D AND &H40
1310 REM FIRST BIT SET?, THEN ADD 1 TO STORAGE
1320 IF D <>0 THEN A=A+1
1330 RETURN
1340 REM
1350 REM *********************************************************
1360 REM (CLOCKIN) READ THE NEXT 7 BITS OF THE VERY FIRST BYTE   *
1370 REM *********************************************************
1380 REM
1390 FOR L = 1 TO 7:REM---------------------:
1400 REM D3 LOW, ALL OTHERS HIGH TO PRTPORT :
1410 OUT(PRTPORT),&HF7                      :
1420 REM D3 LOW, ALL BITS HIGH TO PRTPORT   :
1430 OUT(PRTPORT),&HFF                      :
1440 REM READ ACK SIGNAL                    :
1450 D=INP(ACKIN)                           :
1460 REM MASK RESULT TO 1 BIT               :
1470 D=D AND &H40                           :
1480 REM ADD TO STORAGE IN CORRECT POSITION :
1490 IF D <>0 THEN A=A+(2^L)                :
1500 NEXT L:REM-----------------------------:
1510 RETURN
1520 REM
1530 REM *********************************************************
1540 REM READ ANY ADDITIONAL BYTES AFTER THE FIRST BYTE          *
1550 REM *********************************************************
1560 REM SET LOOP COUNTER TO TOTAL BYTES-1
1570 FOR Y=1 TO BYTESIN-1:REM------------------:
1580 REM CLEAR TEMP BYTE STORAGE               :
1590 A=0                                       :
1600 REM CLOCKIN: READ NEXT 8 BITS             :
1610 REM                                       :
1620 FOR L = 0 TO 7:REM---------------------:  :
1630 OUT(PRTPORT),&HF7                      :  :
1640 REM D3 LOW, ALL OTHERS HIGH TO PRTPORT :  :
1650 OUT(PRTPORT),&HFF                      :  :
1660 REM READ ACK SIGNAL                    :  :
1670 D=INP(ACKIN)                           :  :
1680 REM MASK RESULT TO 1 BIT               :  :
1690 D=D AND &H40                           :  :
1700 REM ADD TO STORAGE IN CORRECT POSITION :  :
1710 IF D <>0 THEN A=A+(2^L)                :  :
1720 NEXT L:REM-----------------------------:  :
1730 REM                                       :
1740 REM STORE RESULT TO RAM POINTER INDATA(Y) :
1750 INDATA(Y)=A                               :
1760 NEXT Y:REM--------------------------------:
1770 RETURN
1780 REM *********************************************************
1790 REM
1800 REM *********************************************************
1810 REM EXIT ROUTINE                                       sp;&nsp;   *
1820 REM *********************************************************
1830 REM
1840 OUT(PRTPORT+2),&HEC
1850 CLS:STOP
Back to The Table of Contents.

Basic Drivers for Write only Routines:

10 REM
20 REM THIS BASIC DEMO WILL WRITE 8 BITS OUT. (1 BYTE)
30 REM A SYSTEM OF LEDS (OR RELAY BOARD) SHOULD BE WIRED UP
40 REM TO VIEW THE RESULTS. CHANGE THE VALUE
50 REM "BYTESOUT" TO INCREASE THE TOTAL BITS TO WRITE.
60 REM UPDATED 6-JUN-94(c) by Don McKENZIE
70 BYTESOUT=1:REM SET UP FOR 8 BITS. (8 BITS=1 BYTE)
80 REM RESERVE MEMORY BYTES FOR FOR DATA OUT
90 DIM OUTDATA(BYTESOUT-1)
100 DIM OUTBITS(8):REM SAVE STORAGE TO MANIP 8 BITS
110 REM
130 REM *********************************************************
140 GOSUB 900:REM SET UP PRINTER PORT                           *
150 REM *********************************************************
160 REM
170 REM *********************************************************
180 REM MAIN PROGRAM LOOP FOLLOWS. WRITE TEXT HEADINGS          *
190 REM *********************************************************
200 CLS:LOCATE 1,1: PRINT "PRINTER PORT USED IS ";HEX$(PRTPORT)
210 LOCATE 3,1
220 PRINT"0 = LED OFF, 1 = LED ON, 2=EXIT":PRINT
230 REM *********************************************************
240 REM GET 8 VALUES FROM KEYBOARD. 0=OFF 1=ON 2=EXIT           *
250 REM *********************************************************
260 FOR X = 7 TO 0 STEP -1
270 PRINT"LED ";X;" ON OR OFF";:INPUT;O:PRINT
280 IF O = 2 THEN 1040:REM EXIT THIS PROGRAM ON "2" KEYPRESS
290 IF O = 0 OR O = 1 THEN 300 ELSE 270
300 OUTBITS(X)=O
310 NEXT X:
320 REM *********************************************************
330 REM CONVERT 8 BIT VALUES TO 1 BYTE AND PRINT RESULTS        *
340 REM *********************************************************
350 PRINT
360 FOR X=7 TO 0 STEP-1
370 PRINT OUTBITS(X);
380 NEXT X
390 PRINT" BINARY":PRINT
400 Y=256:A=0
410 PRINT" Data bit      Value         Multiplier"
420 FOR X=7 TO 0 STEP-1
430 Y=INT(Y/2)
440 IF OUTBITS(X) =1 THEN A=A+Y
450 PRINT X,OUTBITS(X),Y'A,Y
460 NEXT X
470 A$=HEX$(A)
480 PRINT
490 PRINT A;" DECIMAL ";A$;" HEX"
500 REM *********************************************************
510 REM OUTPUT RESULTS USING THE 8 BITS WRITE ROUTINE           *
520 REM *********************************************************
530 GOSUB 630
540 REM *********************************************************
550 REM PAUSE TO VIEW RESULTS OF SCREEN AND LEDS                *
560 REM *********************************************************
570 PRINT:PRINT"PRESS ANY KEY TO CONTINUE.."
580 A$=INKEY$:IF LEN(A$) = 0 THEN 580
590 REM *********************************************************
600 REM DO IT ALL AGAIN                                      &nbsnsp; *
610 REM *********************************************************
620 GOTO 200
630 REM *********************************************************
640 REM START OF WRITE 8 BITS OUT ROUTINE                       *
650 REM *********************************************************
660 FOR Y=1 TO 8
670 REM SET D2 TO D7 HIGH, STORE RESULT IN B
680 B=A OR &HFE
690 REM LOWER D1 (OUTCLOCK), LEAVE D0 AS IS. (OUTDATA)
700 B=B AND &HFD
710 REM OUT TO PRINTER PORT
720 OUT(PRTPORT),B
730 REM RAISE OUTCLOCK
740 OUT(PRTPORT),&HFF
750 REM SHIFT BYTE RIGHT 1 POSITION
760 A=INT(A/2)
770 NEXT Y
780 REM *********************************************************
790 REM RIPPLE BLANK ROUTINE                                    *
800 REM *********************************************************
810 REM D2 LOW, ALL OTHERS HIGH
820 OUT(PRTPORT),&HFB
830 REM ALL BITS HIGH, OUT TO PRINTER PORT
840 OUT(PRTPORT),&HFF
850 RETURN
860 REM *********************************************************
870 REM END OF WRITE ROUTINE                                    *
880 REM *********************************************************
890 REM
900 REM *********************************************************
910 REM PRINTER PORT SET UP. DONE ONCE...                       *
920 REM *********************************************************
930 REM GET LPT1: FROM BIOS
940 DEF SEG=0:X=PEEK(&H408):Y=PEEK(&H409):P=X+(Y*256)
950 REM SET DATA OUT AND DATA IN PORTS
960 PRTPORT=P:ACKIN=PRTPORT+1:
970 REM SET DATA PORT+2 TO &HCC. (NEEDED FOR PS/2 COMPAT.)
980 REM ON PROGRAM EXIT, IT SHOULD BE SET BACK TO &HEC
990 OUT(PRTPORT+2),&HCC
1000 RETURN
1010 REM *********************************************************
1020 REM EXIT ROUTINE                                       sp;&nsp;   *
1030 REM *********************************************************
1040 OUT(PRTPORT+2),&HEC
1050 STOP
Back to The Table of Contents.

Basic Drivers for Read and Write Routines:

10 REM THE REMARKS GIVEN IN THIS SOFTWARE REFLECT THE FLOWCHART
20 REM LABELS PROVIDED WITH MY PPEX PRODUCT AND SHOULD BE VIEWED
30 REM IN CONJUCTION WITH EACH OTHER....
40 REM
50 REM
60 REM PPEX BASIC DRIVERS. WILL READ 64 BITS IN AND WRITES THE
70 REM SAME 64 BITS OUT. A SYSTEM OF LEDS AND SWITCHES SHOULD BE
80 REM WIRED UP TO VIEW THE RESULTS.
90 REM
100 REM
110 CLS:REM DEFINT A-Z: REM UPDATED 30-APR-94(c) by Don McKENZIE
120 REM GET LPT1: FROM BIOS
130 DEF SEG=0:X=PEEK(&H408):Y=PEEK(&H409):P=X+(Y*256)
140 REM SET DATA OUT AND DATA IN PORTS
150 PRTPORT=P:ACKIN=PRTPORT+1:
155 LOCATE 24,1: PRINT "PRINTER PORT USED IS ";HEX$(PRTPORT)
160 REM WRITE TEXT FOR DON MAC FANFARE AND PRETTY HEADER FORMAT ETC.
170 GOSUB 1700
180 REM SAVE 8 BYTES FOR DATA IN AND 8 FOR DATA OUT
190 DIM INDATA(7):DIM OUTDATA(7)
200 REM SET DATA PORT+2 TO &HCC. (NEEDED FOR PS/2 COMPAT.)
210 REM ON PROGRAM EXIT, IT SHOULD BE SET BACK TO &HEC
220 OUT(PRTPORT+2),&HCC
230 REM SET PARAMETERS FOR SPINNING CURSOR
240 N=0:C=24
250 REM ***************************
260 REM MAIN PROGRAM LOOP FOLLOWS *
270 REM ***************************
280 REM
290 LOCATE 12,1
300 REM *********************************************************
310 REM PPEX READ OF 64 BITS FOLLOWS                            *
320 REM *********************************************************
330 REM                                         &n;nbsp;              *
340 REM CLEAR TEMP BYTE STORAGE                                 *
350 A=0
360 REM INLOAD: SET D4 LOW. ALL OTHER BITS HIGH. OUT TO PRTPORT
370 OUT(PRTPORT),&HEF
380 REM ALL BITS HIGH. OUT TO PRTPORT
390 OUT(PRTPORT),&HFF
400 REM READ ACK SIGNAL
410 D=INP(ACKIN)
420 REM MASK RESULT TO 1 BIT
430 D=D AND &H40
440 REM FIRST BIT SET?, THEN ADD 1 TO STORAGE
450 IF D <>0 THEN A=A+1
460 REM
470 REM --------------------------:
480 REM CLOCKIN: READ NEXT 7 BITS :
490 REM --------------------------:
500 REM
510 FOR L = 1 TO 7:REM---------------------:
520 REM D3 LOW, ALL OTHERS HIGH TO PRTPORT :
530 OUT(PRTPORT),&HF7                      :
540 REM D3 LOW, ALL BITS HIGH TO PRTPORT   :
550 OUT(PRTPORT),&HFF                      :
560 REM READ ACK SIGNAL                    :
570 D=INP(ACKIN)                           :
580 REM MASK RESULT TO 1 BIT               :
590 D=D AND &H40                           :
600 REM ADD TO STORAGE IN CORRECT POSITION :
610 IF D <>0 THEN A=A+(2^L)                :
620 NEXT L:REM-----------------------------:
630 REM
640 REM STORE FIRST RESULT (8 BITS) TO RAM POINTER INDATA(0)
650 INDATA(0)=A
660 REM
670 REM 1 BYTE READ, NOW READ 7 MORE BYTES
680 REM SET LOOP COUNTER TO TOTAL BYTES-1
690 FOR Y=1 TO 7:REM--------------------------:
700 REM CLEAR TEMP BYTE STORAGE               :
710 A=0                                       :
720 REM CLOCKIN: READ NEXT 8 BITS             :
730 REM                                       :
740 FOR L = 0 TO 7:REM---------------------:  :
750 OUT(PRTPORT),&HF7                      :  :
760 REM D3 LOW, ALL OTHERS HIGH TO PRTPORT :  :
770 OUT(PRTPORT),&HFF                      :  :
780 REM READ ACK SIGNAL                    :  :
790 D=INP(ACKIN)                           :  :
800 REM MASK RESULT TO 1 BIT               :  :
810 D=D AND &H40                           :  :
820 REM ADD TO STORAGE IN CORRECT POSITION :  :
830 IF D <>0 THEN A=A+(2^L)                :  :
840 NEXT L:REM-----------------------------:  :
850 REM                                       :
860 REM STORE RESULT TO RAM POINTER INDATA(Y) :
870 INDATA(Y)=A                               :
880 NEXT Y:REM--------------------------------:
890 REM
900 REM *********************
910 REM END OF READ ROUTINE *
920 REM *********************
930 REM
940 REM --------------------------------------------------------:
950 REM THIS CODE PRINTS RESULTS OF THE PPEX READ TO THE SCREEN :
960 REM IN BINARY, HEX, AND  DECIMAL. IF BIN$ ISN'T SUPPORTED   :
970 REM BY YOUR VERSION OF BASIC, (EG: GWBASIC) ERROR IS TRAPPED:
980 PRINT " ";:FOR X=0 TO 7                                     :
990 ON ERROR GOTO 1970                                      &nbspbp;  :
1000 A$= BIN$(INDATA(X)):                                       :
1010 IF LEN (A$) <>8 THEN A$ = "0" + A$:GOTO 1010               :
1020 PRINT A$;" ";                                       &nb&bsp;     :
1030 NEXT:PRINT                                        sp;&nsp;       :
1040 PRINT "       ";:FOR X=0 TO 7                              :
1050 A$= HEX$(INDATA(X)):IF LEN (A$) = 1 THEN A$ = "0" + A$     :
1060 PRINT A$;"       ";                                 &nb&bsp;     :
1070 NEXT                                         sp;&nsp;            :
1080 PRINT"     ";:FOR X=0 TO 7                                 :
1090 IF INDATA(X)<99 THEN PRINT " ";                            :
1100 IF INDATA(X)<9 THEN PRINT " ";                             :
1110 PRINT INDATA(X);"    ";:NEXT:PRINT                         :
1120 REM -------------------------------------------------------:
1130 REM
1140 REM -------------------------------------------------------:
1150 REM GET INPUT DATA AND STORE READY TO O/P THE SAME DATA    :
1160 OUTDATA(0)=INDATA(0):OUTDATA(1)=INDATA(1)                  :
1170 OUTDATA(2)=INDATA(2):OUTDATA(3)=INDATA(3)                  :
1180 OUTDATA(4)=INDATA(4):OUTDATA(5)=INDATA(5)                  :
1190 OUTDATA(6)=INDATA(6):OUTDATA(7)=INDATA(7)                  :
1200 REM -------------------------------------------------------:
1210 REM
1220 REM ***************************
1230 REM WRITE 64 BITS OUT ROUTINE *
1240 REM ***************************
1250 REM SET UP DATA POINTERS
1260 FOR X=7 TO 0 STEP-1:REM ------------------------------:
1270 REM GET DATA TO O/P                                   :
1280 A=OUTDATA(X)                                       &nbsnsp; :
1290 REM SET LOOP COUNTER                                  :
1300 FOR Y=O TO 7:REM ----------------------------------:  :
1310 REM SET D2 TO D7 HIGH, STORE RESULT IN B           :  :
1320 B=A OR &HFE                                        sp; :
1330 REM LOWER D1 (OUTCLOCK), LEAVE D0 AS IS. (OUTDATA) :  :
1340 B=B AND &HFD                                       :&ampnbs:
1350 REM OUT TO PRINTER PORT                            :  :
1360 OUT(PRTPORT),B                                     :  :
1370 REM RAISE OUTCLOCK                                 :  :
1380 OUT(PRTPORT),&HFF                                  :  :
1390 REM SHIFT BYTE RIGHT 1 POSITION                    :  :
1400 A=INT(A/2)                                        nbsp;:
1410 NEXT Y:REM ----------------------------------------:  :
1420 REM                                         &p         :
1430 NEXT X:REM -------------------------------------------:
1440 REM
1450 REM RIPPLE BLANK. D2 LOW, ALL OTHERS HIGH
1460 OUT(PRTPORT),&HFB
1470 REM ALL BITS HIGH, OUT TO PRINTER PORT
1480 OUT(PRTPORT),&HFF
1490 REM
1500 REM **********************
1510 REM END OF WRITE ROUTINE *
1520 REM **********************
1530 REM
1540 REM -------------------------------------------------------:
1550 REM SPINNING CURSOR CODE FOLLOWS                           :
1560 IF N<>10 GOTO 1630                                      &p  :
1570 N=0                                         &p              :
1580 LOCATE 15,1:PRINT CHR$(C)                                  :
1590 IF C=24 THEN C= 26:GOTO 290                                :
1600 IF C=26 THEN C= 25:GOTO 290                                :
1610 IF C=25 THEN C= 27:GOTO 290                                :
1620 IF C=27 THEN C= 24                                      &nbsnsp; :
1630 N=N+1:GOTO 290                                       &n;nbsp;    :
1640 REM -------------------------------------------------------:
1650 REM
1660 REM
1670 REM *****************************
1680 REM DONMAC FANFARE TEXT FOLLOWS *
1690 REM *****************************
1700 COLOR 14,0
1710 LOCATE 1,1
1720 PRINT" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&am;Iae;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&ap;IaueÍÍÍÍÍÍÍÍ»"
1730 LOCATE 2,1
1740 PRINT" º  Don McKenzie P.O. Box 595 Tullamarine 3043 Australia (03) 9338-6286 º"
1750 LOCATE 3,1
1760 PRINT" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&am;Iae;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&ap;IaueÍÍÍÍÍÍÍͼ"
1770 LOCATE 4,1
1780 PRINT" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&am;Iae;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»              ns;&bsp;          "
1790 LOCATE 5,1
1800 PRINT" º  Printer Port EXpansion Example Drivers.  (PPEX) º                          "
1810 LOCATE 6,1
1820 PRINT" º                                       &nb&bsp;         º                          "
1830 LOCATE 7,1
1840 PRINT" º  Basic Version Updated 30-Apr-94 (c)             º                   &n;nbsp;     "
1850 LOCATE 8,1
1860 PRINT" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ&am;Iae;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ              &am;bp;           "
1870 LOCATE 10,1
1880 PRINT"     Header 1          Header 2          Header 3          Header 4"
1890 LOCATE 11,1
1900 PRINT"ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄl;ÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
1910 RETURN
1920 REM ****************
1930 REM END OF FANFARE *
1940 REM ****************
1950 REM
1960 REM GWBASIC BIN$ ERROR TRAP FOLLOWS
1970 PRINT "Binary $trings Not supported on this version of Basic.":RESUME 1040
Back to The Table of Contents.

PC Assembly Code:

Updated 14-Jan-95
This explanation is mainly for Customers interested in my Printer Port Expansion board.

 All of my PC Machine Language programs are written using only 8088 instructions. This has been done so that any MS-DOS PC or any computer capable of emulating an MS-DOS PC can be used to drive my kit projects.

 These programs will run on any system that has one of the following CPU types: 8088, V20, 8086, V30, 80186, 80286, 80386, or 80486. This includes the SX, SLC, DX, DX2, variants etc. In fact, any computer system that will support MS-DOS 2.11 to MS-DOS 6.2 will run my Machine Language programs.

 Your printer port must be 100% IBM compatible for the kits that use LPT1:. Read the files in the "PARALLEL" group of files for full details on testing printer ports.
Back to The Table of Contents.

Full Working Files:

Download pipex.zip (75K).

 When I wrote the drivers for the original PIPEX board, I was Involved in 80x88 and Z80 code. This archive includes Source for both of these languages plus lots of other demos and practical programs, such as an EPROM reader program. These files, in conjunction with this group you see now, are the full working files for PIPEX.
 
Home Products Prices Site Map Order Contact What's New Books Free Files Links FAQ

Dontronics Home Page


Copyright © 1996-2005 Dontronics
Top of Page