Give away medical masks when you place an order. learn more
Figure 1: The Silicon Labs CP21xx family of USB to UART bridge ICs allow design teams to add USB support in peripherals with legacy serial interfaces.
The differences in the family members come down to I/O features and memory. For instance, all of the family members include EEPROM that can be used to store USB-specific data such as a vendor ID and even power descriptors. The memory configurations vary from 296 to 1,024 bits.
That USB vendor IC, device type, and other data do not have to be used in specialized embedded applications, but should be used in compliance with the standard if a device design is intended for general usage with USB hosts. The ICs offer from 0 general-purpose I/O lines on the CP2101/02 to 10 I/O lines on the CP2110. You can use those I/O lines for status and control needs.
A USB connection realized with an interface such as SPI can support higher data rates. And a number of companies including Maxim and Microchip have SPI-based USB ICs. And almost all newer MCUs include an SPI interface.
Host or target
Maxim, for example, offers the MAX3420E and MAX3421E USB controllers that can add USB support to any processor-based system that has an SPI port. The ICs work with SPI clocks as fast as 26 MHz. The SPI implementation is a slave-mode interface, meaning that the USB controller requires an SPI master in the MCU or other processor in the system.
A simple USB-bus-powered widget based on the MAX3420E requires little more than the processor, and a voltage regulator that derives a 3.3 V VDD power supply from the USB cable. The MAX3420E IC is used only in USB peripheral or target-device applications. There is an integrated USB full-speed transceiver that supports 12 Mbit/s rates. The IC supports three- and four-wire SPI implementations. It also includes four general-purpose I/O lines.
For USB host implementations, Maxim offers the MAX3421E. That IC includes eight general-purpose I/O lines. The I/O lines can serve a variety of purposes, but in some cases allow the host MCU to essentially reclaim I/O lines that are not available in the MCU because pins are dedicated to the SPI link. Note also that both of Maxim's USB ICs include internal signal-level translators so that the SPI link can operate at voltages ranging from 1.4 to 3.6 V.
Microchip, meanwhile, has a couple of USB-centric ICs to support its efforts in the MCU space, including the MCP2200 USB to UART IC. Microchip’s latest product is quite different in that the MCP2210 USB to SPI IC implements an SPI master-mode link. Figure 2 depicts the block diagram of the IC. It integrates 256 bytes of EEPROM.
Figure 2: Microchip’s new MCP2100 USB controller IC includes a master-mode SPI implementation that can be combined with sensors, data converters, and other peripherals in a bus-powered target device.
The IC could be used to interface with an MCU, but it could also be used to directly control SPI-based ICs with a variety of peripheral functionality. For example, you could use the IC to design USB-enabled data-acquisition modules with no MCU in the target device. Such a module could be deployed with an MCU-based control system or even with a PC.
Consider the possibilities of a USB-powered data-acquisition module. Microchip, for example, offers the SPI-based MCP3204 A/D converter, which could be deployed as a slave to the MCP2100 controller. That four-channel data converter would allow the USB host to capture data over the USB cable.
Microchip offers a number of other SPI-based peripherals that could be combined in such a target device. The MCP2100 USB controller integrates nine general-purpose I/O lines. And eight additional lines could be added using the SPI-based MCP23S08 I/O port expander IC. We covered port expanders in a recent TechZone article (“I/O-Port Expanders Offer Flexibility in MCU-Based Designs”) available in the Hotenda library if you want more information on the topic.
You can also add memory and sensor functionality to an MCP2210-based device. The 25LC02 SPI EEPROM integrates 2k bits of memory. Sensor options include the SPI-based TC77 temperature sensor. Microchip integrated USB HID (human input device)-class support in the MCP2100 and offers drives that will jumpstart the device-design process.
The choice is yours
USB support can prove to be a valuable feature in all types of embedded applications. The interface can eliminate the need to separately include a power supply in your device. You can easily add USB host capabilities into MCU-based systems today. USB-based target devices can work equally well with an MCU-based host or a PC. While an MCU-enabled MCU may be your first thought when faced with a USB design, a dedicated controller IC might be the best choice especially if you are adapting a legacy device to USB or if your design needs a low-cost small-footprint MCU.