[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrong read : readbits




----- Original Message ----- 
From: "Sébastien LICHT" <s.licht@xxxxxxx.fr>
To: <dev-etrax@xxxxxxx.com>
Sent: Thursday, July 22, 2004 4:59 PM
Subject: wrong read : readbits


>
>
> hello
>
>
> after setting some bits with
>
>     ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_CLRBITS ), 1 << bit);
> or
>     ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETBITS ), 1 << bit);
>
> (where "bit" is 1,2,3,4 or 5) ,
>
>
> the "readbits" command seems to be locked  : "0" bits can change to "1"
> but never return to "0" (i forced the pins to GND but no effects)
>
> after reset , the command seems to rework  perfectly

Not sure what you are trying to do.
Please not that bit 1,2,3,4 and 5 on gpiog are both input and output at
the same time but on different pins.
You control the output with IO_SETBITS and IO_CLRBITS but that doesn't
effect the result when reading the pins (unless you connect them together)

>
> I don't understand, because i have used only the IO_CLRBITS or IO_SETBITS
> with 1 to 5 for writting
>
> and i looked for bits 8-15  , i don't touch them
>
> i've also tried to place :
>
> data = mask = 0xFF << 8;
>   ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETGET_INPUT), &mask);
>
> but nothing

Noting what?
That command sets G8-15 to input and updates mask with all bits that
can be used as inputs.


>
> thanks for help

Best regards
/Johan