Overview
All LabJack T-series devices come with Digital Input/Output (DIO) lines. These versatile pins have many uses. This page covers the essential naming conventions, basic software commands, and the hardware details required for most applications.
For a list of the Digital IO available on each device see the tables here: 4.0 Hardware Overview
For more detail or advanced operation see these links:
-
For Hardware Specs: If you need detailed electrical data, such as input impedance or voltage thresholds, see A-2 Digital I/O.
-
For Advanced Features: If you are looking for information on updating the DIO in groups, configuring the Pull-ups, or setting the boot-up defaults visit the Advanced DIO & Configuration page.
-
Serial Communication: Interfacing with other digital logic circuits, sensors, and microcontrollers via SPI, I2C, Asynchronous Serial, and 1-Wire.
-
Measuring & Generating Signals: Output PWM with Phase Control and the ability to output a specific number of pulses. Measure frequency, dutycycle, and quadrature decoding. These are all part of Digital IO Extended Feature (DIO_EF) suite: 12.2 DIO Extended Features
-
Sensirion SHT/SBUS : Special support for Sensirion digital humidity and temperature sensors.
-
Stream: For faster data rates, the states of the DIO can be read using stream. And the DIO can updated using stream_out.
-
Controlling Hardware: Activating relays or solenoids.
Operation
Naming Conventions (FIO vs DIO)
Each digital I/O terminal has two names: a Bank Name and a Simple Name. Originally, bank names described specific hardware capabilities. As our devices have evolved, the features have expanded beyond the limit of the Bank terminology. To simplify future designs, new devices will be labeled using only "DIO#".
Whether your device is labeled FIO, EIO, CIO, or MIO, they all belong to the same Digital I/O (DIO) family. In software, most pins can be addressed by either label (e.g., "FIO4") or their universal index (e.g., "DIO4").
Note: Some advanced functions, such as Digital IO Extended Features, require the use of the Simple Name (DIO#).
Logic Levels
T-Series devices use 3.3V Logic.
-
When set to output, the IO will be driven to 0 or 3.3V.
-
When set to input, if the voltage is below the low threshold (typically 0.9 V) the IO will report 0. If the voltage is above the high threshold (typically 2.1 V) the IO will report 1. See the specifications for the actual thresholds for each device.
5V Tolerance: All T-Series DIO are 5V Tolerant. You can safely input a 5V signal without damaging the device.
If your application requires interfacing with larger voltages, like 24V industrial signals or 5V logic chips that require a full 5V swing, see here
Read and Writing
Each IO line can be configured to be input or output. When set to output they can be set to drive to logic high or logic low. T-Series devices simplify the use of DIO by removing the need for an explicit direction command. Instead, the device will automatically set the direction according to these rules:
-
When a register which accesses one DIO (eg: FIO4, DIO7, etc.) is written to, that line will be set to output.
-
When a register which accesses one DIO is read, that line will be set to input.
Writing to a Single DIO Line
To set the output state of a digital IO line, simple write 0 or 1 to the corresponding register.
Reading from a Single DIO Line
To read the state of a digital IO line, read from the corresponding register.
Read from an output
When using a register which access one DIO which is set to output, the line will be set to input and the state will be read very quickly ( 1 µs). This is often too fast for the actual state of the line to change. To ensure an accurate reading, the line should be reread a few milliseconds after the direction has been changed.
DIO Registers
Examples
Troubleshooting