scope with AD chip on parallel port

Roberto Bucher roberto.bucher at supsi.ch
Wed Jul 12 16:44:11 CEST 2006


Perfect!

Can you give me more info about your 8bit AD/DA card?

Roberto

On Wednesday 12 July 2006 15:22, Raul Herrera wrote:
> Ok, finally my scope is working. I would like to thanks you very much for
> this worndeful piece of work. So I made it work doing this:
> The rtai_DirOutBit remains unchanged, the DirOutBit.c have this
> modifications:
> ...
> void out_DirOutBit_output(int port, double * u,double t)
> {
>   /*     XXXX=*u; */
>     unsigned short aux;
>     aux = inb(BASE+2); // read the control port status
>     if (*u > 0) {
>         aux = aux | 0x31; /* hex 31 = binary 00110001 -> set bits 0, 4 y 5
> to 1, without modification of others */
>         outb(aux,BASE+2); }
>     else {
>         aux = aux & 0xFE; /* hex FE = binary 11111110 -> set bit 0 to 0;
> bits 4 and 5 to 1, without modification of others */
>         outb(aux,BASE+2); }
> }
> ...
>
> For the Input section: the rtai_DirInpBit is modified to:
> ...
>   textmp($+1)='      block->outptr[i][0] = (y[i] * 5 / 256);' /* 8bit AD
> converter in the range 0-5 V */
> ...
>
> and the DirInpBit.c is:
> ...
> void inp_DirInpBit_input(int port, double * y, double t)
> {
>   /*     *y=XXXX; */
>     *y = inb(BASE);
> }
> ...

-- 
University of Applied Sciences of Southern Switzerland
Dept. Innovative Technologies
CH-6928 Lugano-Manno
http://www.dti.supsi.ch/~bucher




More information about the Rtai mailing list