[PARPORT] data rates and interrupt frequency of parport

From: matt (matt@cipherdesign.com)
Date: Sun Oct 28 2001 - 14:34:39 EST

  • Next message: Gian Ghodrat: "[PARPORT] vmware 3.0 parport0 not working"

    Hello list,

    I've been working on a data aquisition project and I've
    got some parallel port / driver related questions that I
    can't find answers to on the web.

    First some background:

    I'm interfacing an optical shaft encoder to a parallel
    port. The parallel port is a SPP/EPP/ECP type. The shaft
    encoder can generate pulses upto 300KHz, and generates 1K
    pulses per revolution. There are 2 outputs, A and B. They
    are both square waves, and are 90 degrees out of phase. So
    if you have an interrupt triggered on A, you can read B
    and find what direction the encoder was turned.

    I've written a simple module that handles the interrupt
    and either increments or decrements a counter depending
    on the status of B. This information is made available
    through a standard device, which blocks on read until a
    new value is read.

    So I can write

    $ cat /dev/opto

    and see streams of numbers when I twist the encoder.

    I've measured the interrupt latency at 60usec and the
    minimum time between interrupts as 80usec. This means that
    I'm capturing data at a maximum of 12.5Khz. If I twist
    the encoder as fast as I can, the numbers end up going
    backwards or otherwise show that I'm losing data somewhere.

    I'm aiming to get the maximum possible data rate (hopefully
    up to 200KHz) with the minimum latency, though this now
    seems unlikely!

    Now some questions:

    I've found various information saying that my parallel port
    should support data rates at up to 2MB/s. I think that this
    must be DMA and hardware helped - so what is a rate that
    I could expect through 1 pins, with the minimum latency
    (ie no DMA or buffering)?

    At the moment I'm using the parallel port interrupt to tell
    me when I've got new data. What is the maximum frequency of
    this interrupt? I had thought that it was dependant on the
    how fast the software can service them, so if my machine
    is running 500MHz, generating an interrupt at 200KHz is
    probably unlikely (only 2500 cycles between interrupts),
    but surely I should be getting more than 15KHz?

    If these are limitations that I am not likely to overcome,
    is there another interface I could use, or would I be
    forced into buying some custom PCI capture card?

    Thanks in advance for any help or pointers to information
    I've missed,

    Matt

    -- 
    #!/usr/bin/perl
    $A='A';while(print+($A.=(grep{($A=~/(...).{78}$/)[0]eq$_}"  A A A  "
    =~m{(...)}g)?"A":" ")=~/([ A])$/){if(!(++$l%80)){print"\n";sleep 1}}
    

    -- 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 Oct 28 2001 - 14:42:13 EST