[PARPORT] problems with handshaking

From: simon.howard@alliedpress.co.nz
Date: Sun Jan 27 2002 - 21:59:06 EST

  • Next message: Petrov M.I.: "[PARPORT] Bidirectional support."

    I have written a device driver and installed it on a machine which
    captures data flowing through the parallel port to a printer.

    my setup is as follows:

    A 25pin ribbon cable connects a machine to a printer, there is a branch
    from this ribbon cable which connects to another machine where the data
    is captured. To catch all the interrupts i have wired pin 1 -> pin10 on
    the cable from that branch that connects to my machine. There is also a
    hardware buffer between my machine and the cable branch, this is to
    ensure that no data from my machine can travel back down the line and to
    the printer, possibly causing an unexpected result.

    print-server ---------------------------- printer
                               [=] <- buffer to let data only travel
    in one direction

    The problem that I am encountering is that i can catch all the
    interrupts alright, but somtimes the same characters are reproduced more
    than once. For example if i was expecting the following:
    i would somtimes get

    it could be any character duplicating so that is why im guessing that it
    has somthing to do with the printer being busy. To gather the data i am
    doing an inb(DATAPORT) when the interrupt arrives:

    void pport_irq(int irq, void * dev_id, struct pt_regs * regs) {

    the value is then placed into a circular buffer and a userland program
    retrives the value from a mmap call (similar to the example on

    If anyone has an idea as to how i can eliminate these duplicate values i
    would greatly appreciate it

    Simon Howard

    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --

    This archive was generated by hypermail 2b29 : Sun Jan 27 2002 - 22:13:35 EST