USBmicro

Your source for USB electrical device interface products.

  • Home
  • Services
    • Design
    • Contact USBmicro
  • Where to buy…
You are here: Home / Documentation / Application Notes / App2: Input

App2: Input

Purpose

Provide a program that reads the state of digital lines connected to the U401⁄U421⁄U451.

Description

This program initializes all of the sixteen i⁄o lines of the U4x1 to be inputs that can then be read by the PC.

The state of the individual lines is displayed on the bottom of the application window. A bright red color indicates that the line is set high, while a dark red color shows that the line is set low.

Screen Shot

Below is the application screen as it looks when the program is first initialized. Both ports (all of the lines) have been set to be inputs.  When new values are read from the ports, the individual boxes (for each line) will change from gray to either bright or dark red.

Hardware

No specific hardware is necessary to run this application. The individual input lines can be connected to either high (+5V) or low (ground).

An interface board such as the DT203 SimmStick can be attached to the U4x1 and read by this application.

An example of a single switch input to the U4x1 (10k ohm resistor would work fine):

An example of an optoisolated input:

Documentation

Open all | Close all