Most of the USB-IO interface adapters support only so-called polling interface. In a polling interface, the client software calls the adapter periodically to retrieve current levels on the I/O pins.
For example: you want to be notified when the voltage on the analog input reaches 4.2V or frequency goes below 500 kHz. With polling approach you have to check the value each x seconds. You have to create an additional thread or timer in your application and to overload the USB bus with each call. And what if frequency goes below 500 kHz immediately after your last poll? Your application will be notified about this only after your next poll. So, to get better latency, you need to poll more frequently, overloading still further your application and the USB bus.
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.
Would you like to analyze changes over time? No problem, USB-IO adapter can send events periodically with the predefined repeat interval.
Besides the event-driven interface, the polling interface is also supported by the GPIO-24 adapter.
Digital Inputs and Digital Outputs (General Purpose Digital I/O)
Each of the 24 I/O pins can serve as a general purpose digital input or digital output. You may set output values for digital outputs and get current values both for inputs and outputs. With GPIO-24 event-driven interface your application can be notified when the input value changes. You can also configure the USB-IO adapter to send events only after specific changes (e.g. when input value changes from logical "1" to "0"). Event sending condition is configured for each digital input pin independently.
Analog Inputs (ADC Module)
5 of the I/O pins can be used as analog inputs connected to 10-bit analog-to-digital converter (ADC). The ADC module is most commonly used to detect variations in voltage, light, temperature or pressure. It can also be used to read switches, potentiometers and other analog devices.
The ADC module can measure input voltage relatively to either internal or external voltage reference. At any time you can read the voltage on the analog inputs. Besides, the USB-IO adapter may send events containing the analog input values. Events are send either periodically with the predefined repeat interval or when the voltage reaches the user defined limits. The limits are specified as low and high threshold values. These limits are constantly compared with the input voltage. The ADC module can generate events when the input voltage:
- descends below the low threshold value;
- rises above the high threshold value;
- leaves the interval specified by low and high threshold values;
- reaches the interval specified by low and high threshold values.
The USB-IO interface adapter has user-configurable comparators module, which consists of 2 comparators. Each comparator compares two voltages and switches its output to indicate which voltage is greater. Comparator module uses 4 I/O pins as analog inputs and 2 I/O pins as digital outputs. The comparator outputs are also available for PC-side software. The comparator inputs can be selected from the analog inputs or from the on-board voltage reference. The comparator voltage reference is a 16-tap resistor ladder network that provides a selectable reference voltage.
At any time you can request the comparison results of both comparators. What is more, you can configure the USB-IO adapter to send periodically events with the results of comparison. The comparator module can also send events to notify the user when the comparison result changes.
Pulse-Width Modulation (PWM) module
USB-IO adapter may produce pulse-width modulation (PWM) output. Any of 24 USB-IO interface adapter I/O pins can be switched into low-frequency PWM mode with configured high time and low time periods. High time is a time period when the output equals to 1, low time - when the output equals to 0. These periods are specified in milliseconds in the range from 1 to 65535 ms (65.535 seconds).
Besides, 2 I/O pins can be configured into the high-frequency PWM (HPWM) mode. The HPWM signal can be generated with the frequency in the range from 1470 Hz to 500 kHz.
Sometimes it is more convenient to send single pulses on demand. Single pulses can be generated on any of the 24 I/O pins. The user can specify the length and logical level of the pulse.
Frequency Counter Module
USB-IO adapter can measure frequency of a digital signal on specified I/O pins. Frequency counter module with 2 counters is used for this purpose. Frequency is measured by counting the number of pulses on the corresponding I/O pin per second. You can read the current frequency at any time. To enable continuous frequency monitoring, the USB-IO interface adapter may periodically send events with current frequency. Or USB-GPIO adapter may send events only when the user-defined measurement limits are reached. To do so, specify a threshold frequency and select the condition of the event generation. The event can be generated:
- when the frequency is lower than the threshold value;
- when the frequency is higher than the threshold value;
- when the frequency is equal to the threshold value;
- when the frequency is not equal to the threshold value.
Pulse Counter Module
The USB-IO interface adapter can count pulses with the help of the pulse counter module. The module consists of 2 pulse counters, that can be configured independently.
Each of the pulse counters can operate in one of the 3 modes. They are:
- Free Run Mode - Pulses are counted continuously. You can suspend, resume or reset the counter and get the number of pulses at any time;
- Time Based Mode - Pulses are counted during the user-defined time period. When the predefined time period is exceeded, the counting starts again from 0 and USB-IO adapter sends an event to PC. The event contains the number of pulses detected during this period;
- Pulse Based Mode - Pulses are counted until the number of pulses reaches the user-defined value. Then the counting starts again from 0 and USB-IO adapter sends an event to PC. The event contains time elapsed from the moment you started the counter.
Weak Pull Up Resistors
USB-IO interface adapter has weak pull-up resistors on some of the I/O pins. Weak pull-up resistors are used to ensure that adapter digital inputs assume a high logic value (logical one) while external devices are disconnected. The USB-IO adapter pull-ups are automatically turned off when I/O pins are configured as digital outputs or analog inputs. In other configurations the pull-up resistors are software controlled.
- Documentation and Downloads
Diolan provides comprehensive set of SW applications to get instant access to all USB-IO Interface Adapter features. Our SW installation package includes source code of these applications that can be used as a good reference and starting point for your own SW development.
Application Name Key Features tracer.exe This program monitors events and responses sent by USB-IO Interface Adapter. All events are formatted and printed on console. You can use this application as is to monitor events during your SW development. command.exe This program sends asynchronous command to USB-IO Interface Adapter. The GPIO command should be provided as command line parameter in a form of 8 hexadecimal numbers separated by spaces. transaction.exe This program sends synchronous commands to USB-IO Interface Adapter and prints the responses received from the GPIO-24 device. The command to send should be provided as 8 hexadecimal numbers separated by space.
Title Links Description User Manual & API manual Installation tutorial, system requirements, software and API description
Windows 7, Vista, XP, 2000 (64-bit)
Package Version Date Key Features GPIO-24.x220.127.116.11.exe [zip] 0.1.6 27 Dec 2010 - Added Gpio24_Gui VB.NET demo application and source code;
- Added Gpio24_Gui C++ demo application and source code;
- Documentation files were revised.
GPIO-24.x18.104.22.168.exe [zip] 0.1.2 29 Mar 2010
Windows 7, Vista, XP, 2000, NT, 98
Package Version Date Key Features GPIO-22.214.171.124.exe [zip] 0.1.6 05 Nov 2010 - Added Gpio24_Gui VB.NET demo application and source code. GPIO-126.96.36.199.exe [zip] 0.1.5 06 Sep 2010 - Added Gpio24_Gui C++ demo application and source code. GPIO-188.8.131.52.exe [zip] 0.1.4 19 Aug 2010 - Documentation files were revised. GPIO-184.108.40.206.exe [zip] 0.1.3 17 Jul 2010 GPIO-220.127.116.11.exe [zip] 0.1.2 29 Sep 2009 GPIO-18.104.22.168.exe [zip] 0.1.1 6 Jul 2009
Package Version Date Key Features gpio24fw.0.4.2.exe [zip] 0.4.2 21 Dec 2010 - Fixed problem with second pulse counter. gpio24fw.0.4.1.exe [zip] 0.4.1 06 Dec 2010 - Fixed auto-reset pins settings;
- Fixed "Fail to send command" bug.
gpio24fw.0.4.0.exe [zip] 0.4.0 19 Aug 2010 gpio24fw.0.3.5.exe [zip] 0.3.5 29 Sep 2009 - Pulse counter functionality. gpio24fw.0.3.4.exe [zip] 0.3.4 18 Sep 2009 - Analog-to-digital converter (ADC) functionality;
- Frequency counter functionality;
- Weak software pull up resistors functionality.