U401/U421/U451 USB I⁄O Interface



The U401⁄U421⁄U451 device provides a simple digital I/O interface for the PC (Win⁄Linux) or Mac (OSX). Sixteen i⁄o lines from the on-board microcontroller are provided. Commands can be sent to the U4xx that change the I/O lines from input to output. I⁄O lines can be individually selected as inputs or outputs. The U4xx supports commands to read the ports, and if the ports are set to output, to write to the ports.

The U401⁄U421⁄U451 can be used as an interface to SPI devices. The firmware on the U401⁄U421⁄U451 provides generic access for reading and writing SPI devices. The SPI clock rate can be adjusted to 62.5 kHz, 500 kHz, 1 MHz, or 2 MHz. Because additional pins are available as generic I/O, the U4xx can use these lines as slave select lines and address multiple SPI devices.

The SPI subsystem of the U401⁄U421⁄U451 can be used as a master to communicate with SPI devices such as EEPROMS and A⁄D converters. The U4xx can also be used as a SPI slave to a microcontroller that uses the U4xx as a gateway to the PC (Win⁄Linux) or Mac (OSX). A PIC or an AVR, for example, can act as a SPI master to communicate data with the U4xx, which can then transfer the data to a PC (Win⁄Linux) or Mac (OSX) application.

The U4xx module is a convenient way to interface a standard Hitachi-type of intelligent LCD controller to USB. The commands that support communication to the LCD module are the “standard” LCD commands. Standard commands include writing characters to the display and controlling the display.

USB interfacing is simple with the U4xx – There are no USB drivers to write and there is no device firmware to develop. There are sample applications that will get you started in minutes. The sample code is available to change for your application.


U4xx Capabilities



Digital I⁄O Interface

The U401 can be programmed to be a simple digital i⁄o interface for the PC (Win⁄Linux) or Mac (OSX) . There are two 8-bit ports, thus sixteen i⁄o lines. There are two commands that set port A and port B i⁄o directions. The individual lines of the port can be set to inputs or outputs on a per line basis, but the command to set the direction operates on an entire port.

The ports can be read with two distinct port read commands. The state of the lines that are set as inputs are returned with the read command. The state of any line that is not set as an input is undetermined and should be ignored.

The ports, when set as outputs, can be written to on a byte-wide basis with two distinct port write commands. Individual line states may be changed with a set of commands that mask the port state and affect only user-specified lines.

A set of commands allow for a byte write to one port, while strobing a user-selected line from another port. The strobe can be either negative-going or positive-going.


LCD Interface

The U401 is a convenient way to interface a standard Hitachi-type of intelligent LCD controller to USB. The commands that support communication to the LCD module are the “standard” LCD commands. Standard commands include writing characters to the display, and controlling the display.


SPI Master

The U401 is an interface to SPI devices. The firmware on the U401 provides generic access to read and write SPI devices. The SPI clock rate can be adjusted to 62.5 kHz, 500 kHz, 1 MHz, or 2 MHz. Because additional pins are available as generic i⁄o, the U401 can use these lines as slave select lines and address multiple SPI devices.


SPI Slave

The U401 can be operated as a SPI slave device. A microcontroller circuit external to the device can transfer data via SPI into the U401. The data can then be read from the PC (Win⁄Linux) or Mac (OSX) with an application. The external processor could be, for example, a PIC that performs data collection and filtering from an analog sensor, and transfers readings to the PC (Win⁄Linux) or Mac (OSX) via the U401.


Stepper Motor Control

The U401 can be operated as a two channel stepper motor controller. The U401 can interface to various types of stepper motor driver circuits. The stepper sequence can be “Wave”, “Full”, or “Half” with control over direction, speed, and step count.


1-Wire Interface

The U401 can interface with 1-wire devices (temperature sensors, i⁄o ports, etc) either on each individual U401 device pin, or on a bus of multiple 1-wire devices.


If you have more information about certain modules, please feel free to Contact us! and share what you know. If you also have test or application code to share, that link is the way to share that - we would appreciate your experiences and input a lot!

If you are interested in purchasing the unique devices that are shown on these pages,
CircuitGizmos (link: CircuitGizmosOnline) sells many of these devices. Also Tindie has several of the CircuitGizmos devices for sale.

If you have questions about sensor modules like these, consider joining the Facebook group.
Join the 37 Sensors FB Group! We'd love to see you there. If you are interested in the CircuitGizmos products, the FB page to join is CircuitGizmos on FB

Sometimes the 37 sensor projects are described as
Instructables. This is the Instructable user to follow: Indestructable and YouTube channel and even follow on Instagram. Link back to us, please! We really like learning how our products are used.

All content, not otherwise posted with a copyright notice, is Copyright 2017+ to the owner of 37sensors.com.