[Linux-parport] Parallel port specific questions

Al Hooton al at hootons.org
Sun Dec 12 12:01:05 EST 2004


	Take a look at parapin: http://parapin.sourceforge.net/

	It's a library, kernel module & device driver that makes it easy to use
the parallel port as a generic digital I/O device from C code, i.e.,
control pins individually to drive TTL-level circuits and retrieve
signals from them.  You can also hook an interrupt handler up to pin 11
to handle asynch situations, but that will take some kernel-level driver
work on your part to write the interrupt handler.

	As for your question regarding timing:  Are you concerned with <1ms
total latency, or <1ms accuracy between changes on multiple pins.  The
latter is definitely possible, and the former might be possible.  My
guess is that you'll have to build a customized kernel to do it, quite
probably based on one of the real-time kernel extension projects out
there.  My suggestion is to start playing with it on the system/kernel
you have now (using the examples that come with parapin, if you chose to
use it at all), hook up an o'scope, and see what you're getting on the
hardware you have.

	Warning: you will almost certainly have to do some kernel-level work to
put all the pieces together, while at the same time achieve the
performance you want.  If your UI is command-line based, a Pentium/100
will do fine.  If you are trying to have a graphical UI based on X
windows, and expect to have things in the UI respond in real-time to
signals on the parallel port, I think you're in for a rough exercise...


On Sun, 2004-12-12 at 18:23 +0200, Sami Tapio wrote:
> Hi,
> I managed to get my self stuck with one project, which involves parallel port 
> polling or IRQs. Let me get a little more specific. Ummh, TOTALLY non profit 
> project, if somebody is wondering...
> Laptop, ~100MHz Pentium, parallel port. What is needed from it? As precise info 
> about 4 input pins on parallel port as possible. Precise? Yes, time precise. As in, 
> 1ms accurate information on when and which pin changed state. 1us would be better, 
> but propably that is way out of the capabilities of the laptop... The info could 
> be written to a file, for example... easy to use it with shell scripts :)
> So, propably kernel module would get the most out of HW, ppdev according to my 
> studying of the subject, could be one solution?
> I'm thinking of using 2.6.x kernel, what kernel options should be considered 
> for the timing accuracy to be the most that is possible for this HW? (Pre emptible, 
> etc) I can manage to do the "UI" and other stuff needed, with shell scripts etc, 
> but with this... I'm lost.
> My C-programming capabilities are non existent, so this is kind of desperate 
> call of help :) 
> Any hints, programming examples, or even working code for this purpose would 
> be greatly appreciated. 
> Best Regards,
> Flexy
> P.S. Please include me on CC list when answering. Thanks.
> _______________________________________________
> Linux-parport mailing list
> Linux-parport at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-parport
> <!DSPAM:41bc70e0141206507423641>

More information about the Linux-parport mailing list