RE: AO consecutive writing - problem

Thanks for your suggestion, this is what I did:

1)upgrade to comedi(0.7.68 / 0.7.21) as Frank recommended.
The Analog Output problem is still there, basically you can use only one AO;
if you write to AO0 3V, you will get 3V at the output, but than if you write
7V
to AO1, the value of AO0 is changing to 0 or other negative values (AO1 will
have the correct value of 7V).

2)I modified cb_pcidas.c as Ashish indicates below.  This solved the
crosstalk for the AI but not the AO.

I would appreciate any other tips you may have.
If I have to start digging into this, is there any overall description of
how modules/drivers are build/interact/ etc ?

Thanks,
George




-----Original Message-----
From: Ashish Golkar [mailto:ashish_at_casde.iitb.ac.in]
Sent: March 19, 2004 6:56 AM
To: pava_at_cs.ubc.ca
Subject: Measurement Computing setup


Hi...just read your email on the DAS card from Measurement Computing...we
faced a similar problem with our DAS 1002...if we used the driver code as
is we got a lot of crosstalk between adjacent channels...we tried changing
the multiplexer settling time in the driver code...the function where we
changed the settling time is listed below...hope it helps.

static int cb_pcidas_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
	comedi_insn *insn, lsampl_t *data)
{
	int n,i;
	unsigned int bits;
	static const int timeout = 10000;

	// enable calibration input if appropriate
	if( insn->chanspec & CR_ALT_SOURCE )
		outw( cal_enable_bits( dev ),
			devpriv->control_status + CALIBRATION_REG);
	else
		outw( 0, devpriv->control_status + CALIBRATION_REG);
	// set mux limits and gain
	bits = BEGIN_SCAN(CR_CHAN(insn->chanspec)) |
		END_SCAN(CR_CHAN(insn->chanspec)) |
		GAIN_BITS(CR_RANGE(insn->chanspec));
	// set unipolar/bipolar
	if(CR_RANGE(insn->chanspec) & IS_UNIPOLAR)
		bits |= UNIP;
	// set singleended/differential
	if(CR_AREF(insn->chanspec) != AREF_DIFF)
		bits |= SE;
	outw(bits, devpriv->control_status + ADCMUX_CONT);

/**************************************************
 wait for mux to settle
**************************************************/
	comedi_udelay(6);  /* <---addition to eliminate crosstalk */

	/* clear fifo */
	outw(0, devpriv->adc_fifo + ADCFIFOCLR);
	/* convert n samples */
	for (n = 0; n < insn->n; n++)
	{
		/* trigger conversion */
		outw(0, devpriv->adc_fifo + ADCDATA);
		/* wait for conversion to end */
		/* return -ETIMEDOUT if there is a timeout */
		for(i = 0; i < timeout; i++)
		{
			if (inw(devpriv->control_status + ADCMUX_CONT) &
EOC)
				break;
		}
		if(i == timeout)
			return -ETIMEDOUT;
		/* read data */
		data[n] = inw(devpriv->adc_fifo + ADCDATA);
	}

	/* return the number of samples read/written */
	return n;
}

-Ashish
-------------------------------
PHOTON+ELECTRON+TRUST=BIG MESS
-------------------------------

Received on 2004-03-25Z22:54:55