
Using TTL-Compatible Digital I/O
Keithley Instruments, Inc.
28775 Aurora Road
Cleveland, Ohio 44139
(440) 248-0400
www.keithley.com
Introduction
This product contains digital input and output devices that use TTL-compatible logic levels. Logic levels describe
which voltage values are interpreted as being on or off. For TTL (Transistor-Transistor Logic, the first widely-used
logic family) those levels are:
• "0" = 0.0 – 0.8 volts
• "1" = 2.0 – 5.0 volts
This note has two purposes:
• to caution you about signals that could cause hardware damage
• to alert you to problems that might prevent the board from operating as you intend
Full details on how to resolve these issues are beyond the scope of this note. Please consult the User’s Guide for this
product, and also the Data Acquisition and Control Handbook, which is available from www.keithley.com at no
charge.
Output considerations
Most users do not use digital I/O board outputs to feed other TTL logic. The outputs instead drive a variety of devices:
indicator lamps, solenoid coils, solid-state relays, etc.
Output current limitations
TTL-compatible output devices can typically sink higher levels of current than they can source. Loads that exceed the
available source current can, if the sink current is sufficient, be connected between +5 VDC and the output and turned
on by driving the output low = ‘off’. (Just remember to allow for the logic inversion in your controlling program.)
Check the User’s Guide for the output specifications.
Boosting output current
If your relay or other output load requires more current or a higher voltage than the board can provide, you can boost
the drive current/voltage by adding a single transistor or (for higher gain) a Darlington pair.
Limits on total output current
When using the KPCI-3160, be aware that because it only has two ground return pins for all 96 potential outputs, the
maximum allowed total output current is 2.0A. (Theoretically, the drivers could sink a total of 9 × 64mA = 6.1A. This
restriction limits them to an average per driver of 20.8mA.) Individual drivers can still sink up to the maximum current as long as the total load current does not exceed 2.0A. (As a practical matter, your PCI slot or computer power
supply may also limit how much current is available.) Check the User’s Guide to see whether such limits apply to
your product.
PA-842 Rev. A / 4-02

•
Output voltage limitations
This product has TTL-compatible output devices that are designed to operate between 0 – 5 volts DC. They are not
open-collector drivers and cannot directly handle voltages outside this range. Do not connect to higher DC or AC
voltages without appropriate interface circuitry.
Protection of outputs
Inductive spikes – The most common problem comes from devices with significant inductance:
solenoids, relays, motor windings, etc. When the current flow stops, the collapsing magnetic field causes a
large voltage spike. This can exceed the breakdown voltage of an unprotected output causing permanent
damage. Add a clamp diode to limit the voltage at the output pin to no more than a diode-drop (typ. 0.7V)
above the output supply. The diode should be rated for at least the voltage and current of the output.
• In-rush currents – Some devices (incandescent light bulbs, for example) may have initial currents many
times higher than their steady-state operating requirement. This can cause outputs to fail. A suitable
small resistor in series with the load (sized to drop about 10% of the voltage at the steady-state current –
R = V/[10 × I]) can limit peak current with little effect on normal operation. In the case of lamps, this will
also extend the life of the bulb.
• Failure currents – Prudent design also requires consideration of ways to protect system hardware from
damage when devices fail, particularly for equipment that will be used over a long period of time. As
with in-rush currents, small series resistors can protect against excessive current if devices become shortcircuited. If nothing else, ensure that the power supply to the output devices is fuse protected so that fault
currents will be interrupted quickly.
Default states
In the case of bi-directional ports that can be configured in software, your system design needs to allow for the default
state they assume between system power-up and when your program has initialized them. In general, ports will initialize as inputs but this could still provide enough bias current to turn on output devices unintentionally. Check to be
sure this causes no hazards in your application.
Input considerations
Inputs that change slowly
If your signal is a slowly changing voltage, for example from a capacitor being charged, it may remain in the “gray
zone” between logic levels so long that it is interpreted as shifting on and off instead of changing smoothly from one
logic level to the other. If you are trying to count the input or take some action when it changes state, this can be a
problem.
Inputs from contact closures (switches, relay outputs, etc.)
Switch contacts can be interfaced by adding a pull-up resistor (10K Ω ). Some boards/chips already include this pullup resistance, or allow you to install it. Check your User’s Guide for more information.
There are two special problems with mechanical switches:
1. When the switch snaps shut, there will be a short period of time, typically 1-5 msec, when the contact surfaces
bounce against each other. This is too fast to see, but the logic input will read it as a burst of on/off signals.
2. Contacts designed for relatively high currents (>100mA) have large contact areas and arc-resistant materials.
These may not perform reliably long-term when switching the small amount of current needed by a pull-up
resistor because the limited signal energy cannot break through the surface contamination film that tends to
build up on the contact. When possible, use switches designed for “dry circuits.” These typically have softer
cross-point contacts that will work well even with small voltages and currents.
2

Inputs with voltages outside the TTL signal levels
The input circuits on most Keithley cards have ICs with internal diodes that will clip signals above 5.5V or below
-0.5V. These provide adequate protection against occasional transients but are not intended to dissipate significant
amounts of energy. If your signal remains outside TTL limits, it will damage the board and/or your signal source. Add
interfacing circuitry so the board sees the TTL logic levels.
NOTE If you have a mixture of input signals with varying levels, consider using a solid-state
relay board. This allows you to install different signal conditioning modules for each input. It is also a way to protect the digital I/O board (and your entire PC system) from
damage if an input accidentally gets shorted or misconnected.
Inputs with electrical isolation
Even if your signal source supplies a TTL-level signal, it can cause damage to your hardware if it comes from a system operating at a different ground voltage. (This should not be a problem if all devices are plugged into the same
power distribution but can occur in manufacturing environments if the PC is on one power system and the other
equipment is fed from a different power system.) Ground should be the same potential everywhere but there are
exceptions. If power will be coming from different sources, isolate your inputs using potential-free contacts (switch
or relay closures) or an optical coupler.
Interrupts
Interrupts are special digital inputs that are connected to Interrupt Request (IRQ) lines. When suitably enabled by a
driver, they cause the processor to interrupt whatever it is doing and respond immediately. This can allow the processor
to handle tasks more efficiently, because it can react when needed instead of waiting for something to happen. Not all
boards provide an interrupt input (consult your User’s Guide). On those that do, the input requires a TTL-compatible
signal and so the same input considerations previously discussed are applicable.
3