[comp.sys.ibm.pc] Is PC parallel port latched?

ycy@walt.cc.utexas.edu (Joseph Yip) (07/14/90)

Hi,

I am trying to use IBM PC's parallel port (printer port) as digital
output port. This will save me from buying a digital I/O card.
The printer port is an 8-bit output. I do not know if the output is
latched or not. This means that if I send a character to the printer
port, will the 8-bit lines stay the same. I 
am thinking of using the parallel port to control a stepper motor. 

If the parallel port is not latched, what is the easiest way to
make it latch?

Thank you.

- Joseph Yip

Email: joseph@zeus.ee.utexas.edu
Tel: (512) 471-1862
Addr: ECE, ENS 520, UT Austin, Austin, TX 78712

depolo@eniac.seas.upenn.edu (Jeff DePolo) (07/14/90)

In article <33965@ut-emx.UUCP> ycy@walt.cc.utexas.edu (Joseph Yip) writes:
>Hi,
>
>I am trying to use IBM PC's parallel port (printer port) as digital
>output port. This will save me from buying a digital I/O card.
>The printer port is an 8-bit output. I do not know if the output is
>latched or not. This means that if I send a character to the printer
>port, will the 8-bit lines stay the same. I 
>am thinking of using the parallel port to control a stepper motor. 

Good question.  About the best I can do is give you a wishy-washy 
answer.  I know that the parallel port is also capable of _receiving_
data.  If you've ever seen some of the parallel port file transfer
programs, you'll see that the parallel port is quite capable of bidirectional
communication.  To get the port to read data, all you do is have the 
sending computer write bytes out its parallel port, which then get latched
in the receiving computer's parallel port.  Then simply read the
contents of the parallel port on the receiving computer.  However, when
sending, I would guess that whether or not the data actually remains at
the port after it is received would depend on current drain on the port.
For example, if there was originally a 1 in bit 0 on the parallel port,
if the other end of the cable had a low Z with respect to ground, the 1
would become a 0.  I have a feeling that this would not be the case with
a normal serial port, as if it were the case, then every time a receiving
device (such as a printer) went to read the port, the 1's would often 
drop to 0's in the middle of the poll.  So, my guess is that it would
depend on the receiving device as to whether or not the data would
stay latched.

>
>If the parallel port is not latched, what is the easiest way to
>make it latch?

Get an octal latch connected to the 8 data lines with the latch-load line
connected to the strobe line.  When the strobe is set high, the contents
of the port will get stuck in the latch until the next byte is written.
Obviously this scheme won't prevent data overruns, however.  Depending
on your application, you may need some sort of buffering.

								--- Jeff




+-----------------------+-----------------------------------------------------+
| Jeff DePolo N3HBZ/AA  | Internet: depolo@eniac.seas.upenn.edu               |
| Univ. of Pennsylvania | RF: 146.685- 224.40- 442.70+ 144.455s (Philadelpia) |
| Computer Science Eng. | Twisted pair: (215) 386-7199 home                   |
|     Class of 1991     | Carrier pigeon: 420 South 42nd St. Philly, PA 19104 |
+-----------------------+-----------------------------------------------------+

mjw06513@uxa.cso.uiuc.edu (Mary Winters) (07/15/90)

In article <33965@ut-emx.UUCP> ycy@walt.cc.utexas.edu (Joseph Yip) writes:
>Hi,
>
>I am trying to use IBM PC's parallel port (printer port) as digital
>output port. This will save me from buying a digital I/O card.
>The printer port is an 8-bit output. I do not know if the output is
>latched or not. This means that if I send a character to the printer
>port, will the 8-bit lines stay the same. I 
>am thinking of using the parallel port to control a stepper motor. 

I believe it is. I use a printer port to control various devices, including
VCRs and an IR controller. When you write a value to the output lines of the
printer port, the states of the output lines remain the same until you write 
a different value.




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