[comp.sys.ibm.pc] INPUT PARALLEL DATA OVER THE PRINTER PORT?

wei@hpctdls.HP.COM (Bill Ives) (05/18/90)

>/ hpctdls:comp.sys.ibm.pc / trejo@nprdc.navy.mil (Leonard J. Trejo) / 10:05 am  May 16, 1990 /
>We're setting up a communications scheme between two PC's
>for a real-time data acquisition application.  I'm just wondering,
>although the bios innterupt 17H does not have a service request
>for parallel input, might there be another way to force the
>printer port to take parallel input coming from another PC?

>Please reply or copy to me via e-mail.  Thank you.


   Since this may be of interest to others beside yourself, I
   have elected to respond rather than email.  Although it is
   true that the parallel port interface chip set could handle
   input (as well as output), when IBM originally designed it
   they did not allow (very well at least) for input in their
   hardware.  This "flaw" in their design has to do with pull
   up resistors on the input lines ( which are too small ) thus
   any input will generate a signal voltage which will cause a
   current to sink into the actual chip set input lines.  Since
   the chips are only rated to sink a few uAmps to a few mAmps, reading
   from the parallel port could be potentially dangerous.  Of course,
   the lower the rating, the more dangerous it is to read. Now, some
   manufacturers design their parallel port interfaces to handle
   input, but you should check before trying it.  My guess is that
   parallel input has never caught on due to it not being possible
   on original IBM equipment (actually burning it out -- I've done
   it so I know).  

   Hope this helps some....
   Bill Ives
   HP CTD
   #include<std-disclaimer>
   

ergo@netcom.UUCP (Isaac Rabinovitch) (05/28/90)

wei@hpctdls.HP.COM (Bill Ives) writes:
>     My guess is that
>   parallel input has never caught on due to it not being possible
>   on original IBM equipment (actually burning it out -- I've done
>   it so I know).  
I'm glad you decided to post this message!  I knew that parallel input
wasn't always possible, but not that it was sometimes dangerous!

Nevertheless, it *has* begun to catch on.  A number of recent products
make use of it, notably the latest version of Laplink, and a developer's
two-node version of LANtastic.

smithju@motcid.UUCP (Justin A. Smith) (05/29/90)

ergo@netcom.UUCP (Isaac Rabinovitch) writes:

>wei@hpctdls.HP.COM (Bill Ives) writes:
>>     My guess is that
>>   parallel input has never caught on due to it not being possible
>>   on original IBM equipment (actually burning it out -- I've done
>>   it so I know).  
>I'm glad you decided to post this message!  I knew that parallel input
>wasn't always possible, but not that it was sometimes dangerous!

I too am glad, i did not know it was dangerous.

>Nevertheless, it *has* begun to catch on.  A number of recent products
>make use of it, notably the latest version of Laplink, and a developer's
>two-node version of LANtastic.

Parallel input *IS* possible on all PC's. - BUT (here it comes) as has been
stated you cant use the 8 outputs. The parallel interface does have four
inputs used by printers to indicate BUISY, PAPEROUT, ONLINE, etc. it is
possible to use these and with some software jigery-pokery, multiplex two
nibbles. OK its not quite 8 bits parallel but 4 bits parallel can still
run faster than serial at 115Kbaud. This is (I think flame on if i'm wrong)
the mechanism used by Laplink and other software that uses input from parallel
ports.

Justin Smith.

-- 
----------------------------------------------------------------------------
             Justin Smith   SYSOP- Orange Crush BBS  (708) 359-5379
                        24 Hours USRobotics HST14400/V.32
Email UUNET smithju@motcid.uu.net  INTERNET motcid!smithju@chg.mcd.mot.com  

emmo@moncam.co.uk (Dave Emmerson) (05/30/90)

> >wei@hpctdls.HP.COM (Bill Ives) writes:
> >>     My guess is that
> >>   parallel input has never caught on due to it not being possible
> >>   on original IBM equipment (actually burning it out -- I've done
> >>   it so I know).  


This has been discussed already this year, so I'll keep it very brief this
time..

Many PC comms boards use the standard Centronics output driver configuration
but have NO provision for INPUT other than 2/3/4 control lines, since they
are only expected to be used as printer/plotter ports. The ouput device
is usually an 'open collector' driver (eg 74ls07) with pull-up resistors and 
filter capacitors. If you connect 2 of these cards together, both can normally
survive, since the current sources are pull-up resistors, although they won't
necessarily 'talk' to each other..

Unfortunately, some boards don't use open-collector outputs, they are one-chip 
implementations, from design packages which do not cater for O/C - if you
connect one of these to ANY other prn port, it WILL DIE - pdq.
How can you tell? Sorry, no easy way, but if both boards feature at least 2
74ls07's near the prn connector, they'll likely survive. Consult the manual
or even the box lid - you'll have paid over the odds for that board, so
they should be at pains to tell you why.

Look for boards which are _specifically_ stated to feature PARALLEL I/O, these
will cost about the same as 2 of the other type. (That's the one you fried
and its replacement anyway - seems fair enough). This is the  Centronics
standard board, it automatically disables its output drive when it detects
input, and can only corrupt data if the control lines are broken.

Centronics is a trademark of the Centronics Data Computer Company.

Dave E.

- Rabbiting as only a carrot-cruncher can -

frisk@rhi.hi.is (Fridrik Skulason) (05/30/90)

In article <3260@galena2.UUCP> smithju@motcid.UUCP (Justin A. Smith) writes:
>Parallel input *IS* possible on all PC's. - BUT (here it comes) as has been
>stated you cant use the 8 outputs. The parallel interface does have four
>inputs used by printers to indicate BUISY, PAPEROUT, ONLINE, etc. it is
>possible to use these and with some software jigery-pokery, multiplex two
>nibbles. 

On most parallel ports true 8-bit input is possible - I know, I have done it.

You get 4 bits from:

	pin 10  ACK
        pin 12  Out of paper
        pin 13  Select
        pin 15  Error

The rest is from the following pins, which are intended as output pins, but
can be used for input.  It is not 100% safe, however.

	pin 1   Strobe
	pin 14  Auto feed
	pin 16  Initialize
	pin 17  Select input.

-frisk
-- 
Fridrik Skulason      University of Iceland  |       
Technical Editor of the Virus Bulletin (UK)  |  Reserved for future expansion
E-Mail: frisk@rhi.hi.is    Fax: 354-1-28801  |   

mjw06513@uxa.cso.uiuc.edu (Mary Winters) (05/30/90)

In article <3260@galena2.UUCP> smithju@motcid.UUCP (Justin A. Smith) writes:
>I too am glad, i did not know it was dangerous.
>
>>Nevertheless, it *has* begun to catch on.  A number of recent products
>>make use of it, notably the latest version of Laplink, and a developer's
>>two-node version of LANtastic.
>
>Parallel input *IS* possible on all PC's. - BUT (here it comes) as has been
>stated you cant use the 8 outputs. 

That depends upon WHICH PC you have. PS/2s come equipped with bidirectional
parallel ports. It's possible some clone makers decided to add this feature, 
also. Other PCs can be modified to allow either input or output through the
8 data output lines, as the PIA chip is quite cabable of either but the PC's
designers chose to hardwire it for output only. This could be as simple as
cutting a trace on the circuit board and soldering a jumper wire between the
cut trace and +5V.




--
uv@f69.n233.z1.fidonet.org
Suffering from PMS (Presentation Manager Syndrome)

mjw06513@uxa.cso.uiuc.edu (Mary Winters) (05/30/90)

In article <7730@canterbury.ac.nz> CHEM194@canterbury.ac.nz (J.DAVIS) writes:
>well, I'm sitting here looking at a PC technical ( hardware ) reference,
>and this is what it's got to say
>
>"output to address 03bch ( for mono graphics/printer adaptor ) or
>                   0378h ( for printer card )
> 
> this instruction captures the data from the data bus and sends it
> to the respective ( data ) pins on the printer adaptor. i.e bits
> 0-7 on pins 2-9 respectively "
>
>"input from address 03bch ( for mono graphics/printer adaptor ) or
>                    0378h ( for printer card )
> 
> this instruction gets data from the pins on the adaptor on to
> the data bus in a similar way to the out instruction on the 
> dame adress"
> 
>Sure looks like fully bi-directional 8-bit to me ....

It might at first glance, but if you actually try it, you'll find that you'll
only be able to read the value last written to that register, not the value of
some external signal applied to the output lines. That is, unless you remove
the ground connection on pin 1 of U4 and tie this pin to +5V, thereby
converting the output port into an input port.



--
uv@f69.n233.z1.fidonet.org
Suffering from PMS (Presentation Manager Syndrome)

CHEM194@canterbury.ac.nz (J.DAVIS) (05/30/90)

> Parallel input *IS* possible on all PC's. - BUT (here it comes) as has been
> stated you cant use the 8 outputs. The parallel interface does have four
> inputs used by printers to indicate BUISY, PAPEROUT, ONLINE, etc. it is
> possible to use these and with some software jigery-pokery, multiplex two
> nibbles. OK its not quite 8 bits parallel but 4 bits parallel can still
> run faster than serial at 115Kbaud. This is (I think flame on if i'm wrong)
> the mechanism used by Laplink and other software that uses input from parallel
> ports.

well, I'm sitting here looking at a PC technical ( hardware ) reference,
and this is what it's got to say

"output to address 03bch ( for mono graphics/printer adaptor ) or
                   0378h ( for printer card )
 
 this instruction captures the data from the data bus and sends it
 to the respective ( data ) pins on the printer adaptor. i.e bits
 0-7 on pins 2-9 respectively "

"input from address 03bch ( for mono graphics/printer adaptor ) or
                    0378h ( for printer card )
 
 this instruction gets data from the pins on the adaptor on to
 the data bus in a similar way to the out instruction on the 
 dame adress"
 
Sure looks like fully bi-directional 8-bit to me ....
 
> ----------------------------------------------------------------------------
>              Justin Smith   SYSOP- Orange Crush BBS  (708) 359-5379
>                         24 Hours USRobotics HST14400/V.32
> Email UUNET smithju@motcid.uu.net  INTERNET motcid!smithju@chg.mcd.mot.com  


-----------------------------------------------------------
| o   John Davis - (Depart)mental Programmer             o |
| o                Chemistry Department,                 o |
| o                University of Canterbury,             o |
| o                Christchurch, New Zealand             o | 
| o                                                      o |
| o      Unet - CHEM194@canterbury.ac.nz                 o |
| o                                                      o |
| o      or email "JOHN DAVIS" on  AmigaINFO BBS         o |
| o                                1200/2400 baud CCITT  o |
| o                                24 hours a day        o |
| o                                NZ +3-371-531         o |

tj@gpu.utcs.utoronto.ca (Terry Jones) (05/31/90)

The tech reference manual says that you read the value applied to the
parallel port ORed with what was last written to the port therefore if you
write 0 to the port you can read data. IT ALSO SAYS that you should NEVER
pull a port pin low (cause if 0 hasn't been written then the pin is high
and if you pull it low you FRY it!) therefore you should use tri-state or
diode isolated signals into the port.

mjw06513@uxa.cso.uiuc.edu (Mary Winters) (05/31/90)

Last night I received some email telling me that my earlier comments were "full
of baloney." Well, definitely not FULL....

I did some more digging, and here's what I came up with. Apparently, the 
original IBM PC had an output-only printer port. The procedure I described
yesterday (where a certain pin's ground connection was removed and the pin
tied high) comes from the book "Interfacing to the IBM Personal Computer" by
Lewis Eggebrecht, and appears to apply to the original PC. Steve Ciarcia, in
a Circuit Cellar article appearing in the September, 1988 issue of Byte 
magazine, has this to say about PC parallel ports:

"Unfortunately, an irritating problem with the design of the PC is that its 
standard parallel printer port is output only. All the hardware needed to
read or write 8 bits of data is already in place, but it lacks a connection to 
enable that function. [...] Figure 5 shows the single cut and addition to
convert a standard parallel printer port to bidirectional operation.
	Of course, all the clone boards (even the IBM boards) seem to use
different IC numbers and assign the bits to different pins on the ICs, so
this modification can be a real mystery. If you are unwilling to chop up your
printer port card, buy a $50 clone printer port card. They are usually 
bidirectional."

The person who emailed me said he has tried bidirectional I/O on various types
of parallel ports, and it always works for him. This seems to suggest that 
while the original IBM PC and clones which copy the hardware of the PC's 
parallel port exactly suffer from the output-only problem, many (most?) third
party ports will work just fine. I found a parallel port card made by 
"Magitronics" or something like that for $20 in Computer Shopper which is
bidirectional (according to the docs), so if your printer port isn't bi, it's
easy and cheap to get one that is.


--
uv@f69.n233.z1.fidonet.org
Suffering from PMS (Presentation Manager Syndrome)

PHYS169@canterbury.ac.nz (Mark Aitchison, U of Canty; Physics) (06/01/90)

In article <7730@canterbury.ac.nz> CHEM194@canterbury.ac.nz (J.DAVIS) writes:
>"input from address 03bch ( for mono graphics/printer adaptor ) or
>                    0378h ( for printer card )
> 
> this instruction gets data from the pins on the adaptor on to
> the data bus in a similar way to the out instruction on the 
> same adress"
> 
>Sure looks like fully bi-directional 8-bit to me ....
 
In article <1990May30.153755.29766@ux1.cso.uiuc.edu>, mjw06513@uxa.cso.uiuc.edu (Mary Winters) writes:
> It might at first glance, but if you actually try it, you'll find that you'll
> only be able to read the value last written to that register, not the value of
> some external signal applied to the output lines. That is, unless you remove
> the ground connection on pin 1 of U4 and tie this pin to +5V, thereby
> converting the output port into an input port.
> 
The answer is, in fact, *some* parallel printer ports allow 8-bit data input,
and some don't! Because of the risks in connecting data to a port that doesn't,
put resistors in series when trying it, e.g. 470 ohm. These will slow the
transfer rate, so you will want to take them out later.  Alternatively use the
handshaking pins for 4-bit transfer. 

Mark Aitchison.