how to precisely correlate time with AI/AO sample counter?

I am running a control loop which finds peaks in AI buffer and has to
react after specified time generating several pulses on digital outputs.

So my question is how to do precise (within 5 us) timestamping?

I am using at the moment mite_bytes_transferred() but unfortunately this
counter does not run smoothly. The samples seem to be accumulated in the
FIFO and then transferred all at once. This gives me +- 100 microsecond
uncertainity on PCI-MIO-16E-1 1.25 MS/s.

Is there any other register in PCI-MIO cards which tells about samples
measured, not DMA? Or may be there is a way to reduce or switch off the
FIFO on some DMA channels?

My analog outpout is synchronized with analog input (started together and
on the same card), but I need digital output which is TSC(CPU) controlled
to be synchronized as well.

Or should I just register COMEDI_CB_EOBUF or COMEDI_CB_BLOCK and hope that
in interrupt handler I would get less jitter (always called with similar
number of bytes in the FIFO)?

If no other solution is found I will probably just smooth out
mite_bytes_transferred(CPU time) function and use this (yes, this is dirty
hack). Constant offset is no problem, but the +- 100 us jitter kills the
application. Of course everything is programmed in kernel space RTLinux.

Best regards,
--
Tomek

Received on 2003-02-09Z11:30:08