I recently bought a USB-IO adapter. It is GPIO-24, produced by Diolan.
I'm interested to know how to set output values for the pins.
The adapter has **broken link removed** which, as I believe, sets output values for specified pins. I send this command with all necessary configuration settings.
Then I send **broken link removed** which returns the pin settings, specified by the former command. That’s ok.
HOWEVER, there is another command – **broken link removed** which returns, among other things, the values on the pins.
The problem is as follows: GPIO_GET_OUT_VAL and GPIO_GET_VAL commands sometimes return different values for the same pins!!!
My guess would be that one returns what you asked the pins to be and the second returns what they actually are. You may tell it to set a pin high but if it's connected to gnd then it will still read back low.
Hi maliwan,
I use this adapter for fan speed control and monitoring. Are you sure that in Byte 3: MASK **broken link removed** you have specified the correct mask? Each bit of this byte corresponds to a specified pin (e.g. bit 0 – to pin 0, bit 1 to pin 1, etc.). Set the corresponding bits/pins to 1, to apply the output values
My guess would be that one returns what you asked the pins to be and the second returns what they actually are. You may tell it to set a pin high but if it's connected to gnd then it will still read back low.
Hi maliwan,
I use this adapter for fan speed control and monitoring. Are you sure that in Byte 3: MASK **broken link removed** you have specified the correct mask? Each bit of this byte corresponds to a specified pin (e.g. bit 0 – to pin 0, bit 1 to pin 1, etc.). Set the corresponding bits/pins to 1, to apply the output values
See the difference between gpio_get_val and gpio_get_out_val commands. GPIO_GET_VAL command returns current values on the pins and GPIO_GET_OUT_VAL command returns output values. Make sure that the pins are outputs when you set the output values for them. If the pins are not configured as outputs, the output values are not applied. They are stored in the embedded memory and would be applied only after the pin is an output.
Is it clear?