
01/05/04
Copyright (C) 2001 - 2004
All rights reserved
Kadtronix
web: www.kadtronix.com
email: info@kadtronix.com
While Digio can perform simple "set" and "get" operations, its real strength lies is its ability to define notification event(s) when input signals, also referred to as "trigger signals" or "input triggers", change state. This is particularly useful in situations where you want to monitor digital inputs or SPI slave devices autonomously. For instance, you can specify that an email message is sent to a designated recipient when bit #12, device #0 changes to a HIGH (1) state. Or specify a digital output to be set when a SPI temperature conroller indicates a high threshold. You could also indicate that a pop-up message appear on the monitor and/or a sound (wav) file is played. The possibilities are limit-less. You'll find Digio an important tool for use in a variety of applications including industrial process control, robotics, hardware design, and prototyping.
Digio uses a USB I/O interface module that connects to an available
USB port on your computer. The module provides 16 I/O signals configurable
in any combination of inputs and outputs. The system is easily expanded
by simply using additional USB modules. (Note: Version 2 and
below of the USB Digital I/O Commander use an ActiveWire USB I/O interface.
Versions 3 and higher use a USBMicro device.)
Kadtronix
web: http://www.kadtronix.com
email: sales@kadtronix.com
Digio uses a USB I/O module card to interface digital signals. Using a compatible cable, plug the device into an available USB port on your computer or into external USB hub. The first time you perform this procedure, the Windows operating system will detect the new hardware and attempt to locate a driver. The required drivers should be already installed as part of your Windows operating system. If your PC has difficulty locating them, browse to your Windows system drivers folder and to find them.
If you are using more than one USB I/O module, plug the additional module(s) into available USB port(s) on your computer. If there are not enough ports, you may need to purchase an external USB hub. Available at computer stores, this device expands the number of available USB ports.
Start Menu -> Programs -> USB Digital I/O Commander
When the program begins, the main display dialog appears as shown below:
The toolbar at the upper right portion consists of 6 large buttons. These controls are convenient quick-select items for choosing some of the more commonly accessed functions. These selections are also available from the menu. From left to right, they are: global properties, SPI control, digital I/O control, attach events, copy attributes, and help. To show the function of a toolbar button, simply move the cursor over it and its description will appear.

The large white area shows the signal list. The signal list presents
a summary of I/O properties associated with a selected device. "Device"
simply refers to a USB module. To select a device, choose it from
the "Select Device" combo-box near the top of the dialog. Note that
the data in the list is not necessarily valid unless the selected device
exists. The status line at the bottom of the dialog indicates the
number of USB modules detected. Devices are designated by virtual
port assignment DEV_nn, where nn indicates a two-digit device number.
If, for instance, the status line indicates 1 device was detected, it will
be assigned to virtual port DEV_00. Additional devices will be identified
with successive port number ID (e.g., DEV_01, DEV_02, etc.) (Note:
Due to the nature of USB enumeration performed by Windows and the means
by which USB modules are identified, it is important that if multiple devices
are used, that they are all attached
before starting the program
and that they are not unplugged during program operation, as this could
adversely affect device identification.)
File -> Save...
You may also delete the database if desired. To perform this operation, make the following menu selection:
File -> Delete...
(In some cases, you may need to delete the database before installing
new versions of Digio.)
Tools -> Properties
A properties dialog will appear containing global properties as shown
below:

Properties are divided into 2 categories: global program properties
and email properties, as described below:
Notification delay provides a means of limiting notifications on signals that are expected to be particularly active. Imagine a scenario in which a signal input being monitored is continually changing states. Without some type of filtering capability, the computer would be bombarded with notification events. The notification delay specifies a minimum time period between successive notifications on any given signal input. Therefore, when an input trigger occurs and generates a notification, this timer will temporarily disable further notification on the signal until the time period elapses. (Note that the delay is imposed only on the trigger signal. All other signal inputs may still be triggered.)
The device poll rate defines the rate at which the attached USB I/O
modules are polled. A faster poll rate yields better response, but
also has the disadvantage of requiring more CPU resources. A slower
rate is recommended where possible.

The following parameters are required for email notifications:
Specify the following parameters only if SMTP authentication is required:
Tools -> I/O Control...

To choose a device, use the "Device" combo-box near the top of the dialog. Remember that although you can configure any device, only those device(s) that are actually plugged in and detected will respond to your configuration. You should first configure the direction (input/output) and states (high/low). (Note: It is not necessary to configure the states of input signals since their states are read from the device.)
Next, assign an optional label for each signal. The label should be descriptive enough to help you remember its purpose. Note the following examples:
Input label examples: "Water level overflow", "Smoke alert", "Device
on"
Output label examples: "Close valve", "Activate motor", "Turn
off light"
There is a special column of numbers in the dialog labeled "Notification Delay". This is a representation of the notification filtering described earlier and provides an indication of when the next allowable notification can occur. Notification on any given signal is temporarily disabled until this countdown timer reaches "0". This feature prevents an overload of notifications on very active inputs.
To see the current value of the timers and input states, press the "Update" button.
The remaining controls on the dialog are convenience buttons aimed at simplifying operations. Without these buttons, you would have to select each signal individually. Of course, it might still be necessary to select signals individually if you are not setting them as all outputs or all inputs. The "Set All Direction" buttons will set all 16 I/O signals as outputs. The "Set All State" buttons set all signals states high or low. Note that state changes, while applied to all signals, only have meaning for signal outputs and have no lasting effect on input signals. The "Notifiy Timers" reset button provides a convenient means of resetting all notification delay timers, re-enabling notification(s). This button should only be used in test situations when you wish to recycle a delay quickly to re-enable notification(s).
Press the dialog's OK button to save changes and exit. Press "Update"
to save changes and without exitting the dialog. Press "Cancel" to
lose changes.
Tools -> SPI Control...

First, choose the desired master device. This is simply the USB module attached to your PC. If there is only one USB module attached, your selection should be DEV_00. Then, select the desired slave device. There can be up to10 selections per master. The slave assignment ranges from 0 to 9 and is somewhat arbitrary. Assign any number to the slave you choose. You may also assign an optional label to each device. The label should be a descriptive string or phrase that helps you remember your assignments. For instance, you could specify "Temperature Sensor, Board 1".
You may now configure the SPI master. When configuring the master, you must select several key attributes. The "Clock" selection specifies the clock rate. For most applications, the slowest clock rate (52Kbits/sec) will be fine. If desired, you may choose a higher rate for time-critical applications.
The "Phase & Polarity" field further defines the clock by specifying the state at which the clock starts (high or low) and on which edge the data is valid. In many instances, the default selection ("Clock starts low, data valid on rising edge) will be correct. However, you should consult the datasheet of the slave device for the correct setting.
Also select the data-width. This field determines the size in bytes of each data transaction with the slave. Choose 1, 2, 3, or 4 bytes. (Note that some devices may not be byte-oriented and may require a transfer that is not aligned to a byte boundary. In these instances, select the next higher byte size. For instance, a device requiring a 6-bit transfer can be defined as 1-byte (8-bits). The two leading or trailing bits should be ignored by the slave device. (Consult the device's datasheet for details.)
The slave-select field determines which digital signal of the master (USB module) will be used to select or enable the slave device. A single digital output must be designated by the master for each slave device exclusively. Choose any available digital signal except those defined for the SPI interface (PA5, PA6, PA7). Note that the slave-select must be defined an output signal. If it is defined as input, you may re-define it using the "..." button. The activation state defines whether the slave device is selected by active-low or active-high signal. In most instances, the selection will be "Low". (Consult the device datasheet for this information.) The mode field defines whether the slave-select should behave as a chip-select or latch-enable. A device defined for chip-select will be selected differently than a latch-enable device. If chip-select, the master will enable or select the slave device, perform the data transaction, and then disable or de-select the device. If latch-enable, the master will perform the data transaction, and then "latch" the data by toggling the signal line. Devices such as shift-registers typically require latching operation. Consult the datasheet for the proper selection to use.
You may also specify an optional data-conversion operation to convert
read data from a raw value to something more meaningful such as degrees,
amperes, volts, etc. To specify a modifier, select one from the combo-box
and enter a value. Then click "->" to transfer it to the edit field
at the right. To specifiy additional modifiers, repeat the process.
You may choose up to 10 modifiers. Each will be performed in the
sequence you have defined them. Modifiers include:
You may also specify a data format from the combo-box list.
These include:
As an example, consider an analog-to-digital converter whose purpose
is to determine the amount of current flowing through part of a circuit.
Rather than dealing with raw readings, we'd like to use amperes instead.
To make the conversion, we determined the following example equation:
Current = (((value >> 2) * 0.15) + 5.0). To effect the conversion,
specify a decimal data format and the following modifiers:
Once you have configured the SPI master and selected modifier(s),
you may test your configuration in the "Test" region. Specify an
optional write value by clicking the "Write" check-box and entering a value.
To read a value, click the "Read" check-box. Then, click the "Go"
button to perform the operation. Choose "Repeat" to perform repitive
reads/writes.
Tools -> Attach Events

To configure an event trigger, you must first select the device and
input signal you wish to become the input trigger signal. Choose
these using the "Device" and "Signal" combo-boxes near the top of the dialog.
If you want to use a dicrete digital signal trigger, select the bit-length
of the input. Typically, this value will be 1, but there may be instances
when you have an input that is characterized by a multi-bit field.
An example of this might be a 4-bit binary-coded decimal (bcd) input.
For this example, you would select a bit-length of 4, resulting in a multi-bit
trigger definition. Otherwise, use the default bit-length of 1, resulting
in a single-bit trigger definition.
| Device=0 | Signal=14 | Bit-Length=4 |
This multi-bit setting is invalid because, beginning at signal 14, there are only 3 signals remaining on the device, not 4.
Shared inputs are allowed. Shared inputs occur when 2 or more
definitions share 1 or more input signals, as indicated in the following
example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The above example indicates that all three definitions share 1 or more signals. Definitions 1 and 3 share signal #7, definitions 1 and 2 share signals #5, #6, & #7. And definitions 2 & 3 share signal #7.
To configure a multi-bit trigger, you must first select the bit-length.
Then choose the trigger event. There
are 3 selections:
Choose "EQ" if you want notification(s) to occur when the input
signals are equal the trigger value. Choose "NE" if you want notification(s)
to occur when the input signals are not equal the trigger value.
Choose "LT" if you want notification(s) to occur when the input signals
are less than the trigger value. Or, choose "GT" if you want notification(s)
to occur when the input signals are greater than the trigger value.
Enter the trigger compare value in the "Value" field. Otherwise,
you may disable notifications on the signal. (The current state &
direction of discrete digital signals are shown in the "State" and "Direction"
columns of the main display. The trigger
compare value will be shown in the "Signal Trig." column of the main
display.)
If the device requires a setup or initialization value, choose one
of the write modes. Otherwise, choose "Read". Next, define
the trigger value in the "Trigger" field. This value will be compared
against the value retrieved from the slave device. Finally, specify
the compare condition. Choose one of the following selections:
Select "equal", "not equal", "less than", or "greater than".
(The trigger compare value will be shown in the "SPI Trig." column of the
main
display.) You may also specify an optional "Setup" value.
Many slave devices require this value. For instance, the setup value
might specify which channel of a multi-channel analog-to-digital converter
to read. Note that SPI operation must be enabled for the USB module
before you can specify a trigger event. To do this, click the button
labelled "..." in the SPI trigger region of the display.
The remaining time trigger selections are repetitive in nature and occur at regular intervals. Select a quarter-hourly trigger when you wish notifications to occur each 15 minutes, ie., 00:00, 00:15, 00:30, 00:45, 01:00, 01:15, 01:30, 01:45, etc.
Half-hourly triggers occur at the following intervals: 00:00, 00:30, 01:00, 01:30, 02:00, 02:30, etc.
Hourly triggers occur each hour: 00:00, 01:00, 02:00, 03:00, etc.
You may further specify a time trigger by selecting which day(s) of
the week they may occur. To include day(s) of the week, check them.
To exclude, uncheck them. Time triggers will only occur on those
days that are checked. (Time triggers are shown in the "Time Trig."
column of the main display.)

Type the message you want displayed and select whether you want an automatic
message. An automatic message is displayed for a selectable period
of time and then is automatically extinguished. Click "OK" once you've
finished configuring the message. You may now preview the message
by selecting the "Preview" button.

Type the name of the recipient for this notification. Use the format "name@domain.com". (Note: Previous versions of Digio required surrounding brackets: '<' and '>'. These brackets are no longer required.) You may indicate multiple recipients in this field with comma separators.
Enter an optional subject for the message. Also specify a body, the actual message you want to send. Instead of typing the message, you can also specify a text file to use. To specify a file, press the "..." button. The contents of the file you specify will be used in the message body. (Note that this is not an attachment.)
If you haven't yet done so, configure
email
properties. These parameters specify the email account and outgoing
mail server. To configure email properties, press the "Properties"
button.

Then select the signal output you want to use. Configure
the desired output state that you want set when the trigger
event occurs. If necessary, use the "Configure
Signal" button to configure an output signal.

Use the browser to locate and select a wav file to be played when the
trigger
event occurs. Once selected, you may preview the sound by pressing
the "Preview" button.

Then press the "..." button to locate the executable (.exe) file.
Enter any command arguments that might be needed. Select "Run the
application minimized" if you don't wish the application to appear on your
computer screen.

Choose the desired SPI master. This is simply the active USB module
the slave is attached to. Also select the slave device. Choose
the hexadecimal value to be written and enter in the "SPI Write Value"
field. If necessary, click the "Configure..." button to configure
the USB master for SPI operation. When complete, click "OK" to save
your changes. Then, click the "Preview" button on the previous dialog
to view and/or test.
Tools -> Copy Attributes...

First specify the source signal. This is the signal having the
attributes you want to copy. Then, specify the destination signal(s).
If you want to copy to a single destination, indicate identical starting
and ending destination signals. To copy to multiple destinations,
specify the range appropriately. For instance, suppose we had configured
device 0, signal 0 as an input with an activated single-bit trigger and
an email notification. If we desired to copy these attributes to
all devices, all signals, we could use the copy feature and specify the
following:
| Device | DEV_00 |
| Signal | 00 |
| Device | DEV_00 |
| Signal | 01 |
| Device | DEV_09 |
| Signal | 15 |
Tools -> Test Outputs

Note that this test requires at least one configured output on the specified
device. If no outputs are found, select another device or re-configure
the current device. You may wish to use the "Config.
I/O.." button to configure one or more outputs.
Along the long edge of the board is the SimmBus compatible connector,
"J1". "J2" is immediately next to J1, and is connected one-to-one electrically.
| Pin Number | USB Interface Signal |
| 1 | <nc> (Pin 1 is located next to the silk screen "J1".) |
| 2 | <nc> |
| 3 | <nc> |
| 4 | <nc> |
| 5 | <nc> |
| 6 | <nc> |
| 7 | +5V USB from PC |
| 8 | <nc> |
| 9 | GND |
| 10 | optional pull up |
| 11 | optional pull up |
| 12 | <nc> |
| 13 | <nc> |
| 14 | <nc> |
| 15 | PA.0 - Port A bit 0 |
| 16 | PA.1 - Port A bit 1 |
| 17 | PA.2 - Port A bit 2 |
| 18 | PA.3 - Port A bit 3 |
| 19 | PA.4 - Port A bit 4 [SPI SS (slave-mode only)] |
| 20 | PA.5 - Port A bit 5 [SPI MOSI] |
| 21 | PA.6 - Port A bit 6 [SPI MISO] |
| 22 | PA.7 - Port A bit 7 [SPI SCLK] |
| 23 | PB.0 - Port B bit 0 |
| 24 | PB.1 - Port B bit 1 |
| 25 | PB.2 - Port B bit 2 |
| 26 | PB.3 - Port B bit 3 |
| 27 | PB.4 - Port B bit 4 |
| 28 | PB.5 - Port B bit 5 |
| 29 | PB.6 - Port B bit 6 |
| 30 | PB.7 - Port B bit 7 |
Other Connectors:
J3 is the USB connection. J4 and J5 are for factory use.
Power connection:
The +5V available on pin 7 of the SimmBus is the power from the PC's USB port. Up to 250mA can be drawn from this supply to power devices attached to the USB interface. If more power is needed, an external supply should be used. Do not attach the +5V from the external supply to this pin. The ground connection of the SimmBus should be common to any external power supply ground as well as any target circuits.
Board Layout:
Note that all lines extend from J1 o J2. There are then some J1 lines that only connect to J2, and no other circuitry.
