[Linux-parport] interrupts with ppdev

Chris Fisichella chris at communityrenewables.com
Mon May 29 00:01:36 EDT 2006

Dear list,

I am trying to use ppdev in a userland program. It would be nice if I 
could use the interrupt feature it supports. Its implementation is not 
exactly clear to me. I read over Tim Waugh's paper several times. It 
seems I need to write a "1" to the IRQ enable bit of the control 
register. After that, interrupts are triggered by a negative going 
pulse on the #ACK pin (pin 10). Well, that is not working for me. I 
reviewed the archives of this list and noticed several other people 
have had questions similar to mine, but nobody has replied.

here is basically what I am doing:
  fd = open(name , O_RDWR); //name is /dev/parport0

ioctl (fd, PPCLAIM)

  // Read the control register
   theData = 0;
   ioctl(fd, PPRCONTROL, &theData)

theData |= 0x10;		//enable interrupts
ioctl(fd, PPWCONTROL, &theData)

  //p. 25 Wait for an interrupt with poll.
code not shown for simplicity, but it is essentially straight from 
Tim's book.

/* this is where I connect a 10k resistor between pin 10 and ground. */

//check to see if an interrupt was sensed
ioctl(fd, PPCLRIRQ, &interruptCount)

...and interruptCount is always zero. That tells me the interrupt is 
not being triggered. Hmm. I am out of ideas.

So, if we can get this working, I'll post the complete code back to the 
list so that others can use it.

Thanks for your time,

More information about the Linux-parport mailing list