📄 ibmlpt.txt
字号:
D3 5 => 15 S3+ direct
D4 6 => 13 S4+ direct
D5 7 => 12 S5+ direct
D6 8 => 10 S6+ direct
D7 9 => 11 S7- inverted
S7- 11 <= 9 D7 inverted
S6+ 10 <= 8 D6 direct
S5+ 12 <= 7 D5 direct
S4+ 13 <= 6 D4 direct
S3+ 15 <= 5 D3 direct
Gnd 25 === 25 Gnd (ground)
Mode 1C: nibble mode, using Data Out to Status In connection; Controls wired
for additional interfaces. This version works with all parallel ports.
Side 1 Pin dir Pin Side 2 connection
------ --- --- --- ------ ----------
D3 5 => 15 S3+ direct
D4 6 => 13 S4+ direct
D5 7 => 12 S5+ direct
D6 8 => 10 S6+ direct
D7 9 => 11 S7- inverted
S7- 11 <= 9 D7 inverted
S6+ 10 <= 8 D6 direct
S5+ 12 <= 7 D5 direct
S4+ 13 <= 6 D4 direct
S3+ 15 <= 5 D3 direct
C0- 1 <=>* 1 C0- direct
C1- 14 <=>* 14 C1- direct
C2+ 16 <=>* 16 C2+ direct
C3- 17 <=>* 17 C3- direct
Gnd 25 === 25 Gnd (ground)
* Note: Control Out bits on receiver set high (including inversion, ie:
C0,C1,C3=0; C2=1). Control feedback on receiver can read control out from
sender. Can use some lines each way, and could switch C0 - C2 and C1 - C3
for symmetry if we want two lines each way, or other variations.
Mode 2: 8 bits, using bidirectional parallel port
This version works only with bidirectional parallel port whose Data Out
can be tristated; the receiving side must tristate its Data Out port to
use its feedback register as an 8 bit input port.
Side 1 Pin dir Pin Side 2 connection
------ --- --- --- ------ ----------
D0 2 <=>* 2 D0 direct
D1 3 <=>* 3 D1 direct
D2 4 <=>* 4 D2 direct
D3 5 <=>* 5 D3 direct
D4 6 <=>* 6 D4 direct
D5 7 <=>* 7 D5 direct
D6 8 <=>* 8 D6 direct
D7 9 <=>* 9 D7 direct
C0- 1 => 13 S4+ inverted
C1- 14 => 12 S5+ inverted
C2+ 16 => 10 S6+ direct
C3- 17 => 11 S7- direct
S4+ 13 <= 1 C0- inverted
S5+ 12 <= 14 C1- inverted
S6+ 10 <= 16 C2+ direct
S7- 11 <= 17 C3- direct
Gnd 25 === 25 Gnd (ground)
* Note: bidirectional cards only; receiving side must tri-state with C5=1
If a two bidirectional ports are left connected in this fashion, and they
are both enabled (eg: after powerup or reset) with different data outputs,
then the 74LS374 driver chips could be "fighting". Just to be careful,
when I created a cable like this (actually, a DB25 jumper box usually sold
for RS-232 jumpering, along with straight through 25 line DB-25 cables), I
used 8 10K resistors between the corresponding Data lines, to limit current
in this case. (Actually, a DIP resistor pack fit perfectly on the PC board
inside the DB-25 jumper box). The resistors are large enough to keep TTL
output from overstressing another one if both enabled, but when one is
disabled and the other enabled, the resistors are low enough to allow the
TTL output to drive a TTL input well enough.
Mode 3A: 8 bits, using Open Collector Control Outputs as inputs
This version uses 4 control outputs as inputs, plus 4 status inputs.
Side 1 Pin dir Pin Side 2 connection
------ --- --- --- ------ ----------
D0 2 =>* 1 C0- inverted
D1 3 =>* 14 C1- inverted
D2 4 =>* 16 C2+ direct
D3 5 =>* 17 C3- inverted
D4 6 => 13 S4+ direct
D5 7 => 12 S5+ direct
D6 8 => 10 S6+ direct
D7 9 => 11 S7- inverted
C0- 1 <=* 2 D0 inverted
C1- 14 <=* 3 D1 inverted
C2+ 16 <=* 4 D2 direct
C3- 17 <=* 5 D3 inverted
S4+ 13 <= 6 D4 direct
S5+ 12 <= 7 D5 direct
S6+ 10 <= 8 D6 direct
S7- 11 <= 9 D7 inverted
Gnd 25 === 25 Gnd (ground)
* Note: Control outputs used as inputs must be programmed high:
C0, C1, C3 = 0 and C2 = 1
Mode 3B: 8 bits, using Open Collector Control Outputs as inputs
This version uses 3 control outputs as inputs, plus 5 status inputs;
remaining control output is bidirectional - if left high by default,
either side can pull low (remember inverted logic).
Side 1 Pin dir Pin Side 2 connection
------ --- --- --- ------ ----------
D0 2 =>* 1 C0- inverted
D1 3 =>* 14 C1- inverted
D2 4 =>* 16 C2+ direct
D3 5 =>* 15 S3+ direct
D4 6 => 13 S4+ direct
D5 7 => 12 S5+ direct
D6 8 => 10 S6+ direct
D7 9 => 11 S7- inverted
C0- 1 <=* 2 D0 inverted
C1- 14 <=* 3 D1 inverted
C2+ 16 <=* 4 D2 direct
S3+ 15 <=* 5 D3 direct
S4+ 13 <= 6 D4 direct
S5+ 12 <= 7 D5 direct
S6+ 10 <= 8 D6 direct
S7- 11 <= 9 D7 inverted
C3- 17 <=> 17 C3- direct (OC shared)
Gnd 25 === 25 Gnd (ground)
* Note: Control outputs used as inputs must be programmed high:
C0, C1, C3 = 0 and C2 = 1
[A future version of this document may sketch out the code to send and
receive data through these connections]
17. Capturing "printed" data from another machine
A computer with a bidirectional printer port, connected with a Mode 2
cable to any standard port, could potentially pretend to be a printer
so as to capture the "printed" information. It would configure its
Data port for input, and set appropriate values on its Control Out to
mimic a printer on the other computer's Status In lines. In the general
case, the problem would be detecting the very brief -Strobe pulse; this
would either require an external TTL latch triggered by -Strobe (either
edge), or some way to sense a quick pulse on that line. In the latter
case, a revised connection (call it Mode 2B) could connect the "printing"
computer's -Strobe (C0-) line to the receiving computer's -Ack (S6+) line;
the trailing edge of the printing computer's -Stobe would generate an
interrupt on the receiving computer. I have not tried this. Of course,
the +Busy line would also be needed to avoid data overflow; perhaps it
could be kept high (busy) most of the time, but pulsed low after reading
the data (which would be handled by the IRQ routine).
[If anybody has had some success with this, let me know.]
18. Controlling Outputs
This can be easy; just use the Data Out TTL signals to control TTL level
items. Unfortunately, they cannot source much current (providing positive
voltage on the pin, relative to ground) - be careful of the 2.6 mA limit.
Some LSI implementations might allow more or less than this (likely less).
Dn Out ------+
|+
Sourcing Load (up to 2.6 mA @ 2.4 v)
|-
Ground ------+
If you have an external +5 volt supply, you have two options: use the Data
Out pins to sink up to 24 mA from your +5 volt supply, or use buffer chips
to control (source or sink) more current (or higher voltages). I have
used an exteranl 5 Volt supply (regulated wall wart) plus optocoupled solid
state relays as the "load", to control AC voltages (keep the high AC voltages
away from any of this logic level stuff, obviously).
+------------------------------- (+5 v)
|+
Sinking Load (up to 24 mA @ 4.2v)
|- Power Supply
Dn Out ------+
Ground -------------------------------------- ( Gnd)
Use limiting resistors if you need to limit the current.
If the load were an LED (or optocoupler) through which you wished to put
20 mA, do the calculations. The Dn Output will probably be around 0.7
volts, so you have about 4.3 volts of drop; the LED will drop about 1.9 v
(check specs!), leaving 2.4 V to be dropped by a resister at 20 mA: 120
ohms. Test and measure, adjust to fit.
You can also use the Control Out pins. They can't source much of anything
(about 1 mA through the 4.7K resistors to +5), and can only sink about 7mA.
(The LS TTL gate actually sinks 8 mA, but one is taken up by the 4.7 K
resistor to +5). Again, check on clones with different electical specs.
This can control TTL inputs fine, and might be able to run an optocoupler
or solid state relay in sink mode (depends on the device).
In one application, I used two 74ACT374 latches, which can source 48 mA
or sink 64 mA. I connected the 8 inputs of each to the Data Out, and the
latch clocks to two Cn outputs. In software, I put out 8 bits of data
on the Data Out port, pulsed a Cn bit to latch it into one 74ACT374,
put the next 8 bits out on Data Out, and used the other Cn bit to latch it
into the other 74ACT374 - voila, 16 bits of 64mA output control. Of course,
this took a separate +5 V power supply ($5 surplus regulated wall wart).
If you can still find an old TTL parallel port (especially with sockets),
you can substitute the 74ACT374 chip for the original 74LS374 and get better
drive capability. The back of magazine suppliers were selling *fully
socketed* TTL based parallel ports for about $15 a few years back; by cutting
a trace and soldering a jumper you could make them bidirectional; by plugging
in a $1 chip you could make them source/sink 48/64 mA. You might still find
such TTL parallel port cards in old PCs. Typically, one designed for the
original PC will still work fine on the ISA bus of your 486DX2-66, so don't
worry about that.
19. Sensing switches
There are several ways to sense external switches via a parallel printer
port. If you are dealing with naked switches, the simplest is actually
to connect up to 4 switches between the control outputs (pins 1,14,16, and
17) and ground, program the control outputs high (counting inversions), and
use the control feedback register to read switch state (counting inversions).
This is because the pull-up resisters are already implemented for the open
collector Control Out pins.
Cn Out ------+ (Program output high; read feedback)
|
switch
|
Ground ------+
Another simple method would be to use up to 5 pullup resistors (4.7K) from
the Status inputs to +5 volts, and use switches to pull these down to ground.
One disadvantage of this is that it uses an external +5 supply. TTL inputs
tend somewhat to float high, so you *might* get by without the pullup
resistors, but you are pushing it.
4.7K
Sn In -------+-^^^^^--- (+5 v) (Read status register)
|
switch
|
Ground ------+---------- (gnd)
You could use this same scheme for 8 inputs on the data lines of a
bidirectional printer port - but you have to be sure that the outputs are
tristated beforehand, or your switches may damage the 74LS374 (or equiv).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -