Re: MCC PCI-DAS1602/16

I'm still not sure what is causing the problems with the 
MCC PCI-DAS1602 board and the cb_pcidas driver. Something
here seems to be tying the system up for very long times
- order of 4ms or more.

I've added the following to the interrupt handler in cb_pcidas.c
(comedi-0.7.67 version). Running the demo cmd.c program shows
an average of about 9 samples in the fifo after the driver
reads the fifo. Just before we get the fifo overflow, the
number jumps for a couple of interrupts to 200+. Sometimes
the value is larger than the fifo!

You would think that a 512 sample fifo would be large enough
to handle 64000 samples per second. It takes 8 ms to fill the
fifo. Even with the puny 450MHz CPU we really shouldn't be
having problems. I'll try Monday or sooner to run the same 
test from the same disk in a 2GHz machine.

I also wonder if every thing is getting cleared at the end
of the interrupt. 

Any one got an idea?

John

The following changes to cb_pcidas.c pull samples from the fifo
until it is empty and report how many were pulled. Not necessarly
the best way to do it.

*** cb_pcidas.c	2003-11-01 08:30:01.000000000 -0700
--- cb_pcidas.c.orig	2003-11-01 08:22:53.000000000 -0700
***************
*** 1517,1524 ****
  	static const int timeout = 10000;
  	unsigned long flags;
  	int retval = 1;
-     int adne_cnt = 0;
-     int full_fifo = thisboard->fifo_size;
  
  	if(dev->attached == 0)
  	{
--- 1517,1522 ----
***************
*** 1576,1619 ****
  			async->events |= COMEDI_CB_EOA;
  			cb_pcidas_cancel(dev, s);
  		}
- #if 1
-         else
-         {
-             /*
-              * John Conner - 20031031
-              * Always leave with the fifo empty. 
-              * Should never need to pull more than half_fifo of 
-              * data since we just pulled that much from the fifo.
-              * But some how we are seeing more than half_fifo 
-              * samples still in the fifo. At a sample rate of 
-              * 64000 samples per second we still get overflows!
-              */
-             //if((ADNE & inw(devpriv->control_status + INT_ADCFIFO)) != 0)
-             //    rt_printk("A/D fifo is not empty - %d\n",++adne_cnt);
-             for(i = 0; i < full_fifo*2; i++)
-             {
-                 // break if fifo is empty
-                 if((ADNE & inw(devpriv->control_status + INT_ADCFIFO)) == 0)
-                 {
-                     break;
-                 }
-                 else
-                 {
-                     adne_cnt++;
-                 }
-                 cfc_write_to_buffer( s, inw( devpriv->adc_fifo ) );
-                 if(async->cmd.stop_src == TRIG_COUNT &&
-                     --devpriv->count == 0)
-                 {		/* end of acquisition */
-                     cb_pcidas_cancel(dev, s);
-                     async->events |= COMEDI_CB_EOA;
-                     rt_printk("A/D fifo had %d samples \n",adne_cnt);
-                     break;
-                 }
-             }
-         }
-         rt_printk("A/D fifo had %d samples \n",adne_cnt);
- #endif
  		// clear half-full interrupt latch
  		comedi_spin_lock_irqsave( &dev->spinlock, flags );
  		outw(devpriv->adc_fifo_bits | INT, devpriv->control_status + INT_ADCFIFO);
--- 1574,1579 ----

Received on 2003-11-01Z16:16:31