Re: [PARPORT] instruction execution time problem

From: Michael Reinelt (reinelt@eunet.at)
Date: Sun Dec 22 2002 - 04:48:59 EST

  • Next message: Dan Smith: "[PARPORT] Xmas project: pg0: Autoprobe failed"

    Hi,

    > but my problem is there is some time delay for
    > execution of instruction , which limits the sampling
    > rate.
    >
    > i can only sample at a rate of 300 samples per
    > second...
    > that means it is taking 3 ms for execution of less
    > than 10 instructions........

    THe problem you are facing is that all usleep, udelay, ... functions in
    userspace are using the linux scheduler, and therefore delay at least on
    e timer tick (which should be about 10 msec).

    > Is there any solution to this problem..... how can i
    > increase my sampling rate ????

    It's quite complicated to get fine-granulated delays with linux in
    userland. You have to do busy-waiting.

    Take a look at lcd4linux (http://lcd4linux.sourceforge.net), especially
    the file udelay.c (use the CVS version, the tarballs are quite
    outdated). Here I implemented a userspace timer with nanosecond
    resolution, which uses either timeofday() or TSC (time stamp counter) on
    modern processors.

    If you have any questions, feel free to ask.

    bye, Michael

    -- 
    netWorks                                          Vox: +43 316  698260
    Michael Reinelt                                   Fax: +43 316  692343
    Geisslergasse 4                                   GSM: +43 676 3079941
    A-8045 Graz, Austria                          e-mail: reinelt@eunet.at
    

    -- 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 Dec 22 2002 - 04:51:25 EST