Interrupt for parallel port on 4 pins?

Interrupt for parallel port on 4 pins?

Post by fprint » Wed, 14 Jun 2000 04:00:00



I am looking at the various documentation I can find on
programming for the parallel port about coding for interrupts.
I have a slot car timing system that repeatedly polls the
parallel port for "events".  I have been told that if I could
figure out a way to do so, using interrupts would be *far* more
efficient.  I can understand that it would be, however I am
looking at the value of 4 pins on my parallel port, one of which
is Pin 10 - which is the pin that generates the interrupt.  I
cannot just look at activity on Pin 10 to generate my interrupt
- I need to look at any/all pins.

Is it possible to designate activity on pins 10, 11, 12 and 15
to generate an interrupt?  If not, is there a better way to
monitor activity on those pins other than a constantly cycling
do loop?

do
{
  inb()
  if (activity) process function

Quote:}

Thanks!
Stuart

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

Interrupt for parallel port on 4 pins?

Post by Javier Gostling D » Thu, 15 Jun 2000 04:00:00




Quote:> I am looking at the various documentation I can find on
> programming for the parallel port about coding for interrupts.
> I have a slot car timing system that repeatedly polls the
> parallel port for "events".  I have been told that if I could
> figure out a way to do so, using interrupts would be *far* more
> efficient.  I can understand that it would be, however I am
> looking at the value of 4 pins on my parallel port, one of which
> is Pin 10 - which is the pin that generates the interrupt.  I
> cannot just look at activity on Pin 10 to generate my interrupt
> - I need to look at any/all pins.

> Is it possible to designate activity on pins 10, 11, 12 and 15
> to generate an interrupt?  If not, is there a better way to
> monitor activity on those pins other than a constantly cycling
> do loop?

If I get it right, you want to write an interrupt handler in userspace,
right?. Hmm... not likely... What frequency do you require to poll? If it's
not too fast, then using a polling loop wouldn't be that much of a drain in
system resources (mainly CPU). Consider most people use the lp driver in the
kernel in polling mode, and lpd doesn't seem to impact overall system
performance at all...
- Javier

 
 
 

Interrupt for parallel port on 4 pins?

Post by Frank Sweets » Fri, 16 Jun 2000 04:00:00



>Is it possible to designate activity on pins 10, 11, 12 and 15
>to generate an interrupt?  If not, is there a better way to
>monitor activity on those pins other than a constantly cycling
>do loop?

No.  Only pin 10 can generate interrupts - it's a hardware limitation.  Search
for the parapin library on freshmeat.net - it's a nice library for monitoring
individual pins either from user space and kernel space, with some decent docs
too.

--
Frank Sweetser rasmusin at wpi.edu, fs at suave.net
Full-time WPI Network Tech, Part time Linux/Perl guy
But then it's a bit odd to think that declaring something int could
actually slow down the program, if it ended up forcing more conversions
back to string.

 
 
 

Interrupt for parallel port on 4 pins?

Post by David Gauchar » Fri, 16 Jun 2000 04:00:00



> Is it possible to designate activity on pins 10, 11, 12 and 15
> to generate an interrupt?  If not, is there a better way to

No

Quote:> monitor activity on those pins other than a constantly cycling
> do loop?

Yes, you should not use pin10 in your hardware.
Use another pin: Say you use 6,7,8,9. Now you
can add 4 diodes (I'm french, not sure diode
is the same word in english, the symbol is -|>|-)
from pins 6,7,8,9 to pin 10. Now each time sthing
occurs on any of the pin 6,7,8,9, an interrupt
is generated (from pin 10) and your handler is
able to read the parport.
Now, its not easy to get an interrupt in user space,
but I've a module that does this if you are interested.

david

 
 
 

Interrupt for parallel port on 4 pins?

Post by Brian J Luczkiewic » Tue, 27 Jun 2000 04:00:00


I could recommend, if you don't mind a possible security hole created by your
app, that you use a device in the /dev directory (or devfs if you use it) and
possibly use a system call such as poll or select on /dev/port or
/dev/parport....I'm all from memory and it's late here, so correct me if I'm
wrong...

Brian


> I am looking at the various documentation I can find on
> programming for the parallel port about coding for interrupts.
> I have a slot car timing system that repeatedly polls the
> parallel port for "events".  I have been told that if I could
> figure out a way to do so, using interrupts would be *far* more
> efficient.  I can understand that it would be, however I am
> looking at the value of 4 pins on my parallel port, one of which
> is Pin 10 - which is the pin that generates the interrupt.  I
> cannot just look at activity on Pin 10 to generate my interrupt
> - I need to look at any/all pins.

> Is it possible to designate activity on pins 10, 11, 12 and 15
> to generate an interrupt?  If not, is there a better way to
> monitor activity on those pins other than a constantly cycling
> do loop?

> do
> {
>   inb()
>   if (activity) process function
> }

> Thanks!
> Stuart

> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

1. have C code for parallel i/o, pin by pin (for interfacing)

A while ago I posted for help, asking how to control and read from the
individual pins of the parallel port, with the hope of being able to
control some simple circuits, etc, with my computer.

A few people responded, but none offered code to do what I wanted to
do.  Since then, I have answered my own question and have thrown
together some C functions that handle parallel i/o pin by pin.  If
anyone is interested, send email.

--



           http://ajshrom.student.princeton.edu |             Linux ...

2. UMSDOS and XFree86

3. Control ecpp parallel port on pin level

4. I luv FreeBSD !!

5. Help. Data pins in parallel port not responding

6. gcc-2.95.2 compile failure on XP1000 running suse 6.3

7. want to control and read pins on the parallel port individually

8. problems with configuring ESS Maestro soundcard

9. Parallel port programming... pins 12 and 13 not working

10. Pin outs for parallel port zip drive cable?

11. Setting pin on parallel port high

12. parallel port: why +5V on pin 12 in rest

13. Watching parallel port for a pin to go to ground?