USB to IO interface adapter GPIO-24 - need help

Discussion in 'Electronics Resources' started by jacobs, Apr 12, 2010.

  1. jacobs

    Thread Starter New Member

    Apr 12, 2010
    6
    0
    Hi,

    I've just purchased the original USB-IO interface adapter – GPIO-24 produced by Diolan http://www.diolan.com (perfect choice, I know) and I want to create an interface using about 6-8 pressure sensors.

    I need each sensor to notify me when it is on/off.

    I implemented the following algorithm: I periodically send commands to check the state of each sensor (on or off). If a sensor is on, another piece of code is executed.

    However, this algorithm proved to be not so efficient. And I'll tell you why. I intend to use 6-8 pressure sensors. I need to check state of every sensor no more rarely than once per second. So, every second my application has to send 6-8 commands just to check the state of the sensors!!! Such conditions are unacceptable, as it overloads the USB.

    Are there any tips or cheats to avoid such overload? Any help is appreciated!

    Thank you.

    P.S. Note, that I have a small experience in C :)
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    USB endpoints can be setup in a number of different ways. There is the interrupt endpoint which only talks when it has something to say, and there is the bulk endpoint which is good for streaming data, and there is the isochronous endpoint which is good for periodic updates. Do you have the flexibility to control either the host or function endpoints in terms of configuring things or are you stuck with canned software on both ends?
     
    jacobs likes this.
  3. SilvestroMor

    New Member

    Apr 13, 2010
    1
    1
    I'm using Diolan adapters, too: Gpio-24 for my research work and U2c-12 adapter for educational purpose.

    Gpio-24 usb-io adapter has such a handy feature: it can send messages (or events, as they call them) when the value on pins changes.

    Look, what they write on the official site:
    "GPIO-24 differs from most of other low-cost USB-IO adapter by the event-driven interface. It means that the USB-IO interface adapter can notify your PC software immediately after the input value has changed. The event-driven interface is very flexible. The conditions of an event generation can be configured for every GPIO-24 module independently. For example, ADC module can send events when the voltage on the analog input descends below predefined value. Or rises above, say, 4.7V."
    http://www.diolan.com/io/gpio24.html

    No doubt, that you can configure the adapter to send messages when you sensors are on/off. Personally I set the adapter to send messages when a new device is plugged and when a pin value changes from HIGH to LOW.

    Good luck with your project!
     
    jacobs likes this.
  4. jacobs

    Thread Starter New Member

    Apr 12, 2010
    6
    0
    Hi SilvestroMor,

    Thanks for the tip! I've got what I needed now... Cheers!!!
     
  5. jacobs

    Thread Starter New Member

    Apr 12, 2010
    6
    0
    Hi Papabravo,

    Thanks you for a quick reply.

    Yes, I've realized now, that I have the opportunity to control the endpoints.

    Sorry for my tech-ignorance: I'm not so experienced with USB-I/O adapter :(
     
Loading...