Alternating Periods with COMEDI Analog Input (fwd)

Though I originally sent this to the RTAI list, I have forwarded it
(see the original letter below) here since Paolo implied that the
problem might be due to COMEDI.

This is running on a NI PCI-MIO-16 board with a recent 'comedi-cvs'.

Can anyone here explain the behavior?

Thanks,

  -Kenneth

----------------------------------------------------------------------

Forwarded message 1

  • From: Kenneth Jacker <khj_at_be.cs.appstate.edu>
  • Date: Tue, 27 Mar 2007 09:02:00 -0400
  • Subject: Alternating Periods with COMEDI Analog Input
I've written a short test program that digitizes channel 0 at a 100 Hz
rate (a 10ms period).  The samples are being obtained OK, but the
period is "jumping around".

Here's some output that I wrote using rt_printk() within the data
acquisition thread:

     [17193743.472000]: 0
     [17193743.480000]: 13145
     [17193743.492000]: 33813
     [17193743.500000]: 53721
     [17193743.512000]: 65535
     [17193743.520000]: 64582
     [17193743.532000]: 50673
     [17193743.540000]: 30000
     [17193743.552000]: 9976
     [17193743.560000]: 0
     [17193743.572000]: 0
     [17193743.580000]: 13405
     [17193743.592000]: 34119
     [17193743.600000]: 53964
     [17193743.612000]: 65535
     [17193743.620000]: 64463
     [17193743.632000]: 50405
     [17193743.640000]: 29698
     [17193743.652000]: 9728
     [17193743.660000]: 0

As you can see the period is switching between 12ms and 8ms ...
The *average* period is the expected 10ms, but why the variation?

Here's the program (ain.c):

  
Most likely I'm doing something stupid!

Thanks for your ideas,

  -Kenneth
-- 
Prof Kenneth H Jacker       khj_at_cs.appstate.edu
Computer Science Dept       www.cs.appstate.edu/~khj
Appalachian State Univ
Boone, NC  28608  USA        

Received on 2007-03-27Z21:36:09