Parallel Port I/O programming

Parallel Port I/O programming

Post by B.K.GOODCHIL » Fri, 02 May 1997 04:00:00

Can anyone tell me where i can find more infomation on parellel port I/O
programming.  I have read the mini-HOW-TO but i want more info.
If anyone has got any info they would me willing to share please contact

Richard Case


1. Parallel port programming (was Game port programming)

        Well, you do need a driver.  But there is a parallel port driver already
through which you can communicate.  And then the rest can certainly be
written in a high level language.  You can talk to your parallel port
through read/write calls to /dev/lp -- I'm pretty sure.  I'll bet it's not
/dev/lp, but you can find it in your dmesg output or just go to /proc/ and
look at devices.  It has the same interface as a character based file.  That
is, you can't lseek, but you can read and write to the port.  If all you
have is 8 flip relays hanging off the port, it's trivial to talk to it.  If
you've got more, then you have to dream up some kind of protocol.  For
example, if you have 16, you could have the protocol where the first 8 bits
(the first pulse) drive the first 8, and the second pulse through the port
drive the next 8.  Printers work on a much higher level.  They communicate
streams of data from machine to machine and the data contains the
instructions on what to do.  Mostly they're bit streams, but occassionally
(sp!) there will be instructions for color change, end-of-line (i.e., the
rest of this line is 0 bits, so why send it?), etc.

        Using the port of your machine should be easy and fun!!
        You can actually go to an electronics enthusiasts store (like Radio Shack
in the United States) and buy two bit books which describe how to build a
parallel port LED gizmo.  You could certainly drive that from shell scripts.

        ~> echo "a" > /dev/lp

would turn on a simple bit pattern on the device.

        ~> echo "Hello" > /dev/lp

would turn on a flashing bit pattern on the device.

-- Randy

ps: you're right, "spamhasruinedemail"

2. Where to find an old perl binary for SCO?

3. Parallel Port programming question, was "Serial Port Programming"

4. (no subject)

5. parallel port printer and parallel port superdisk

6. Diamond Stealth 64DRAM v1.03/Mitsubishi DiamondScan 17FS

7. Multiple parallel ports/IRQ sharing/non-use of IRQ by parallel ports?

8. Radio Card

9. parallel port programming for linux?

10. Linux parallel port program

11. Programming Parallel port

12. Parallel port programming: i386 only?

13. How do I access a Sparc parallel port from a C program?