- From: Wiktor Grebla <greblus_at_poczta.onet.pl>
- Date: Fri, 23 Apr 2004 21:05:49 +0200
Hi.
Tired of trying to force an old Advantech PCL 818L card to read data
asynchronously I've decided to ask here, hoping to get some suggestions
about the driver itself and get what I want from this card (:
I'm writing a small data aquisition program which I want to use for
my thesis, all it has to do at the moment, is to read data from a few
channels "simultaneously".
First try was on a Slackware-9.1 distro kernel 2.4.22. I used
comedi-cvs-20040407 (some compilation problems were fixed in
cvs) and comedilib 0.7.21.
After modeprebing pcl818, according to driver description driver
was configured for DMA mode 1, (slack kernel has rtc compiled in so
mode 2 wont work).
comedi_config /dev/comedi0 0x210,7,1,0,1,1 pcl818l
info program displayed (I'm interested only in the subdevice 0):
overall info:
version code: 0x000744
driver name: pcl818
board name: pcl818l
number of subdevices: 4
subdevice 0:
type: 1 (analog input)
number of channels: 16
max data value: 4095
ranges:
all chans: [-10,10] [-5,5] [-2.5,2.5] [-1.25,1.25]
command:
not supported
comedi_test:
I: Comedi version: 0.7.68
I: Comedilib version: unknown =)
I: driver name: pcl818
I: device name: pcl818l
I:
I: subdevice 0
I: testing info...
rev 1
I: subdevice type: 1 (analog input)
number of channels: 16
max data value: 4095
ranges:
all chans: [-10,10] [-5,5] [-2.5,2.5] [-1.25,1.25]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 34 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
No luck, then I thought about RTAI, and prepared following packages,
this time based again on Slackware almost vanilla 2.4.22 kernel,
rtai-3.0r3 (rthal5 patch), comedi and comedilib from CVS (2004/04/20).
kernel and rtai configs can be found here (it's slackware ide-config not
modified intentionally only the rtai added):
http://www.republika.pl/greblus/comedi/config-2.4.22-rthal5
http://www.republika.pl/greblus/comedi/rtai_config.3.0r3
(BTW I didnt find the way to compile RTAI with CONFIG_RTAI_CPLUSPLUS
three or for strange unresolved symbols, in both cvs and stable versions).
This time info told me:
verall info:
version code: 0x000744
driver name: pcl818
board name: pcl818l
number of subdevices: 4
subdevice 0:
type: 1 (analog input)
number of channels: 16
max data value: 4095
ranges:
all chans: [-10,10] [-5,5] [-2.5,2.5] [-1.25,1.25]
command:
start: now
scan_begin: follow
convert: timer|ext
scan_end: count
stop: none|count
command fast 1chan:
start: now 0
scan_begin: follow 0
convert: timer 25000
scan_end: count 1
stop: count 2
So it was a little bit more optimistic, however cmd command hanged like
this:
nd before testing:
start: now 0
scan_begin: follow 0
convert: timer 1000000
scan_end: count 4
stop: count 1000
first test returned 0 (success)
start: now 0
scan_begin: follow 0
convert: timer 1000000
scan_end: count 4
stop: count 1000
second test returned 0 (success)
start time: 1082744000.377696
Syslog shows the following:
greblus kernel: ***** STARTING THE UP REAL TIME SCHEDULER WITH LINUX *****
greblus kernel: ***** FP SUPPORT AND READY FOR A PERIODIC TIMER *****
greblus kernel: ***<> LINUX TICK AT 100 (HZ) <>***
greblus kernel: ***<> CALIBRATED CPU FREQUENCY 1193180 (HZ) <>***
greblus kernel: ***<> CALIBRATED TIMER-INTERRUPT-TO-SCHEDULER LATENCY 2514 (ns) <>*** greblus kernel: ***<> CALIBRATED ONE SHOT SETUP TIME 1676 (ns) <>***
greblus kernel: ***<> COMPILER: gcc version 3.2.3***
greblus kernel: comedi: version 0.7.68.1 - David Schleef <ds_at_schleef.org>
greblus kernel: rt_pend_tq: RT bottom half scheduler initialized OK
greblus modprobe: modprobe: Can't locate module char-major-98-0
greblus kernel: comedi0: pcl818: board=pcl818l, ioport=0x210, irq=7, dma=1, 16chans S.E. DAC
greblus kernel: check_channel_list: seglen 4
greblus last message repeated 2 times
greblus kernel: pcl818_ai_cmd()
greblus kernel: pcl818_ai_cmd_mode()
greblus kernel: check_channel_list: seglen 4
greblus kernel: mode13dma_int, mode: 1
greblus kernel: pcl818_ai_cmd_mode() end
greblus kernel: pcl818_ai_cmd() end
greblus kernel: pcl818_ai_cancel()
greblus kernel: pcl818_ai_cancel() end
After turning off DMA, what is quite... stupid:
cmd shows:
dma 0, [3] set to 1
command before testing:
start: now 0
scan_begin: follow 0
convert: timer 1000000
scan_end: count 4
stop: count 1000
first test returned 0 (success)
start: now 0
scan_begin: follow 0
convert: timer 1000000
scan_end: count 4
stop: count 1000
second test returned 0 (success)
start time: 1082743498.045533
read: Broken pipe
end time: 1082743498.050843
and in syslog we may find:
greblus kernel: pcl818_ai_cmd_mode()
greblus kernel: check_channel_list: seglen 4
greblus kernel: pcl818_ai_cmd_mode() end
greblus kernel: pcl818_ai_cmd() end
greblus kernel: comedi: A/D mode1/3 IRQ - channel dropout 1!=0 !Apr 23 10:41:54 greblus kernel: pcl818_ai_cancel()
greblus kernel: pcl818_ai_cancel() end
greblus kernel: check_channel_list: seglen 4
I think I should ask Mr. Michal Dobes who wrote the driver, but I prefer
to ask here - is there a chance for this card to work with asynronous data
aquisition?
I was thinking about removing rtc to release IRQ 8 for DMA mode 3, but
DMA mode 1 should work, isnt it?
Another idea was to use comedi_rt_timer, but It doesnt solve the problem,
cmd hangs the same way in DMA mode 1.
I'll be really greatfull for any help and suggestions.
Thanks in advance.
Regards
W.
PS. If I wont solve the problem I've more old cards in the lab to check.
If you could confirm whether they're supported by comedi (i dont see
it anywhere): very old DAS-4061 & 62 and IOTECH DAQBOOK 100.
--
Rule of Life #1 -- Never get separated from your luggage.
Received on 2004-04-23Z18:05:49