Index

37 Sensors Overview

Sensor.Engine MICRO

  1. Sensor.Engine MICRO Features
  2. Pinout and Pin use
  3. BASIC Overview
  4. SEM Library functions

37+ Sensors

  1. Analog Hall-effect
  2. Analog Joystick
  3. Analog Temperature
  4. Ball Switch
  5. Bi-color LED
  6. Button
  7. Character LCD
  8. Flame
  9. Hall-effect Switch
  10. HMI Display
  11. Humidity and Temperature
  12. IR Receiver
  13. IR Transmitter
  14. Keypad
  15. LASER
  16. Light Cup
  17. Liquid
  18. Mercury Switch
  19. Microphone
  20. Multicolor Flashing LED
  21. Obstacle Avoidance
  22. Photo Interruptor
  23. Photoresistor
  24. Piezo Driver or Annunciator
  25. Pulse
  26. Reed Switch
  27. Relays and Drivers
  28. RGB LED
  29. Rotary Encoder
  30. Servo
  31. Shock and Impulse
  32. Speaker
  33. Temperature 18B20
  34. Temperature Threshold
  35. Touch Sensor
  36. Tracking
  37. Ultrasonic Distance

USBmicro U4xx

  1. U401
  2. U421
  3. U451

CircuitGizmos

Projects

  1. Controlling MedeaWiz Sprite

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.