views:

156

answers:

4

If I understand the parallel port right, sending data from (D0 to D7) simultaneous, but that it can control the sticks individually? example:

D0 = Input
D1 = Input
D2 = Output
...
...
...
D7 = Input

would it work? what I want to do is to both send and receive data simultaneously.

thank.

A: 

Of course by sending a number that has just the required bit set (2n) you'd get the expected result.

I'm not sure about bidirectional access though. I guess it's achieved by using control pins along with the data pins but that's just a guess.

Mehrdad Afshari
+1  A: 

Data wires (D0-D7) are being read or set simultaneously. For various tecniques for bidirectional I/O read the attached articles:

Standard parallel port: http://www.beyondlogic.org/spp/parallel.htm

EPP: http://www.beyondlogic.org/epp/epp.htm

ECP: http://www.beyondlogic.org/ecp/ecp.htm

Dmitry Khalatov
A: 

Parallel ports doing EPP or ECP only allow D0-D7 to be all input or all output. Trying to do otherwise may fry your hardware.

See http://www.nor-tech.com/solutions/dox/ieee1284_parallel_ports.pdf, page 6.

However, parallel ports have several control lines that may be useful if you only need a small amount of input/output in the "other" direction.

The paralell port IOs are usually protected against IO overcurrent (either by the MOSfet sizes that make the IO or serial resistors). It won't fry.
jpinto3912
A: 

This site is a good source for programming the parallel port.

The basic idea is that you need a DLL, add-on or library that allows you to access the I/O Ports of the PC. For Windows XP on up you need a specific driver that will allow you do this as the OS doesn't offer access out of the box.

The Parallel port will generally reside at one of three address 278,378, 3BC. This port. have the bytes you are reading or writing.

The (base)+1 port allows access to the status bytes. IE. 279,379, 3BD

The (base)+2 port allows access to the control bytes. IE. 27A,37A,3BE

The parallel port documentation will tell not only how to implement the common modes (like bi-directional) but how to control the port at the byte level to implement your own custom.

Back in the day there was only the standard mode available. You pump out your bytes at the (base) port. Some application, like mine, manipulated individual bits of that ports as form of cheap Digital I/O Controller. We did use the status and control bytes as additional inputs and outputs. There were commands you can send to the Parallel Port chip configure the modes precisely.

Today there are are hundreds of sites with example of using the Parallel Port to solve all kinds of problems. I would be surprised that one of doesn't have something you can use for you specific application.

Again the book I recommend starting with is Parallel Port complete. It tells just about everything you need to start with. If your application is too esoteric for that book it will give a springboard from which you can find the exact setup you need.

RS Conley