Using the parport with Linux

This page might help if you want to attach your own stuff to the parallel port. Here are some small C programs to get started with parport programming.
parport-1.2.tar.gz
There is also a bash script to do it, as well as an outdated kernel module to measure time between parport interrupts. Read the README, compile, run.

Pin Assignments
Here are some useful links:
The Linux I/O port programming mini-HOWTO, including a section about timing issuers
tons of great parport documentation
ledblink, a unix command line tool if you attach LEDs to the parport.
mailblink, acutally the same as ledblink, but specialized to blink you mail count.

What I have attached right now to my parport is a switch to start / stop playing my music collection, skip the current song or shut down the PC. I can boot it without a monitor and use it as a music box, with one single switch. (code is at svn://log2.ch/code/fernd)
Other ideas / things I did:

Here is an extract from a Mail by JimVela@aol.com:

At any rate, on to a quick summary. Here are some URLs that I've come across in searching. First, here's a way to read and write to the parallel port under Linux:
http://www.bitwizard.nl/par/index.html
With some work, this stuff could be used to read the status of various switches attached to the input ports of the parallel port (or, similar techniques could poll the serial port, although there are fewer readable signal lines on serial)
Next, here's a spot on sunsite:
http://sunsite.unc.edu/pub/Linux/system/status/!INDEX.short.html
There is a whole bunch of software here to display status to LED and LCD hardware attached to the parallel port. I will be experimenting with this, and hope to be able to display load (CPU, or interface) on LEDs.
Next, check out this site:
http://ugrad-www.cs.colorado.edu/~boggs/pbus/pbus.html
These guys have actually been building a parallel BUS interface around the parallel port. I'm especially intrigued by this because the colorado.edu (CU Boulder) is about a 5 minute drive for me... I may drop some mail to these guys to see if I can stop by and look around...
Also, I found this helpful:
http://www.jb.man.ac.uk/~dm/tech/linux_pport.html
One or more of the above may link to each other; that's how I found them...
My thoughts are that the following MIGHT be usefull:
1) a LED bargraph display that could attach to the parallel port, and display some metric (CPU utilization, WAN/LAN utilization, routing speed, etc...). This could even be built by lopping the connector off of the ribbon cable, and then soldering up the display directly to the wires. You could also then seperate the input lines and attach switches, etc... (would not require attaching things to the parallel port and then running cables back inside the case...)
2) as mentioned above, some mechanisim to read the status of the parallel (or serial, as Chris suggests above...) port input lines, and take action upon them. The possibilities for this are endless- bring up or take down a line, monitor some other device and take action (security, alert, monitoring, etc.)
3) with an LCD pannel as described in the articles in the URLs above, you could put up displays. Imagine scrolling something like these messages to the display:
"Router OK"
"PPP Connection UP"
"Ethernet 0 10 Mbps 30% utilization"
"Ethernet 1 100 Mpbs 03% utilization"
I'm going to start experimenting with this stuff, so will contribute more as I learn more...


Created in September 2001 by Martin Renold, updated in May 2004.
Back to my homepage (mostly german)