- From: Bernd Porr <BerndPorr_at_f2s.com>
- Date: Mon, 19 Jul 2004 15:47:49 +0100
Hi Folks,
here's a new usbdux driver.
It's just now in bugzilla (as attachements) and on this page here:
http://www.linux-usb-daq.co.uk/dev/
I've implemented two 16 bit counters with Up/down and reset.
Is there also demand for 4 counters without a reset line? Sampling rate
is 500Hz for the two counters. Might become 250Hz for four counters.
And: The duxboard can now sample at 8kHz under USB 2.0.
Any feedback appreciated.
/Bernd
P.S.: modified "dio.c" to test the counter without additional hardware
(I generate the pulses at the digital port by software):
// Testing: all channels as outputs!!
// If you want to supply a signal to DIO change to COMEDI_INPUT
for(channel=0;channel<8;channel++) {
comedi_dio_config(device,subdevice,channel,COMEDI_OUTPUT);
comedi_dio_write(device,subdevice,channel,1);
}
comedi_dio_write(device,subdevice,0,1); //clock
comedi_dio_write(device,subdevice,1,1); //up/down
comedi_dio_write(device,subdevice,2,0); //reset
// reset counter
ret=comedi_data_write(device,3,0,0,0,0);
channel=0; // counter clock
i=1;
while (1) {
usleep(20000);
comedi_dio_write(device,subdevice,channel,1);
usleep(20000);
comedi_dio_write(device,subdevice,channel,0);
// counter
ret=comedi_data_read(device,3,0,0,0,&ctr_data);
if(ret<0){
comedi_perror(filename);
exit(0);
}
printf("%d\n",ctr_data);
}
return 0;
--
www: http://www.berndporr.me.uk/
http://www.linux-usb-daq.co.uk/
Mobile: +44 (0)7769 506746
Work: +44 (0)141 330 5237
Department of Electronics & Electrical Engineering
Room 519, Rankine Building, Oakfield Avenue,
Glasgow, G12 8LT
Received on 2004-07-19Z13:47:49