Re: cb_pcidas64 / usage / AO / DIO

I have given up trying to get port B or C to act as inputs - I am just using 
them as outputs now.

The maximum speed I can drive these DIOs appears to be 200kHz (5us pulse 
width).  I understand 8255 can go at up to 8MHz and the PCI bus should allow 
me to far exceed 200kHz.

Does anyone know what the comedi limit is on these devices and why? could I 
change this somehow?

Thanks,

SA



On Monday 15 Aug 2005 15:10, SA wrote:
> Dear List,
>
> On my pci-das4020/12 card I have a puzzling problem, the board has a 8255
> on it for DIOs.  I can successfully write to all channels (0-23, ports
> a,b,c), however, I cannot read from ports B and C (channels 8-23).
>
> The channels in ports B+C all return 1 regardless of input, does anyone
> have any suggestions? because I am quite stuck now.
>
> Thanks,
>
> SA
>
> Also several of the errors in the dio library don't set the error number
> correctly (for instance "wrong subdevice" sets the error as "success").
>
> I presume that when you set the direction for one channel in a port then
> all the other channels in that port also have their direction set- is this
> correct?
>
> --------------------------- code used to test digital input --------------
>
>
>         for(i=0;i<10000;i++){
>                 usleep(100000);
>                 for(channel=0;channel<20;){
>                                 printf("A(");
>                                 for(i=0;i<8;i++,channel++){
>                          
> ret=comedi_dio_read(device,subdevice,channel,&data);
> printf("%d",(int)data);
>                                         if(ret==-1){
>                                                 comedi_perror("The error
> is"); printf("%d\n",comedi_errno()); }
>                                         }
>                                 printf(") : B(");
>                                 for(i=0;i<8;i++,channel++){
>                          
> ret=comedi_dio_read(device,subdevice,channel,&data);
> printf("%d",(int)data);
>                                         if(ret==-1){
>                                                 comedi_perror("The error
> is"); printf("%d\n",comedi_errno()); }
>                                         }
>                                 printf(") : C(");
>                                 for(i=0;i<4;i++,channel++){
>                          
> ret=comedi_dio_read(device,subdevice,channel,&data);
> printf("%d",(int)data);
>                                         if(ret==-1){
>                                                 comedi_perror("The error
> is"); printf("%d\n",comedi_errno()); }
>                                         }
>                                 }
>                         printf(") %d channels read\n",channel);
>                         }
>
> ---------------- output from code ------------------------------
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00100000) : B(11111111) : C(1111) 20 channels read <- A2 toggled
> A(00100000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read <- B2 toggled
> A(00000000) : B(11111111) : C(1111) 20 channels read
> A(00000000) : B(11111111) : C(1111) 20 channels read
>
> ---------------code used to driver DOs --------------------------
>        for(i=0;i<10000;i++){
>                 usleep(2000000);
>                 if(out==1)out=0;
>                         else out=1;
>                 for(channel=0;channel<24;channel++){
>                          
> ret=comedi_dio_write(device,subdevice,channel,out); if(ret==-1){
>                                         comedi_perror("The error is");
>                                         printf("%d\n",comedi_errno());
>                                         }
>                                 }
>                                 printf("%d\n",out);
>                         }
>
> --- this code works, all DIOs switch from 0v to 5v every 2 seconds---
>
> _______________________________________________
> comedi mailing list
> comedi_at_comedi.org
> https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi

Received on 2005-08-16Z18:17:15