ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

IMPLEMENTING A SIMPLE USB INTERFACE FOR AN EMBEDDED PROCESSOR


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

IMPLEMENTING A SIMPLE USB INTERFACE

Lessons from the Trenches FOR AN EMBEDDED PROCESSOR

by Stuart Allman

Start ý Typical USB Solutions ý Required Components ý An Easier Solution ý Following the Rules ý Firmware ý Vendor-Specific Requests ý Host Transfer Mechanisms ý USB Transfers ý How Does It Work? ý The Grand Conclusion ý Sources and PDF

REQUIRED COMPONENTS

There are five main elements that are required to communicate on the USBýUSB SIE, peripheral processor, peripheral firmware, host driver, and host application.

The USB SIE can exist as a standalone memory-mapped peripheral or be integrated in a microcontroller. The SIE takes data at the transaction level and transfers the bits out at the physical level, and vice versa.

The second element is the peripheral processor. Most USB solutions today demand a processor solution of some kind to handle USB transactions, although some USB peripherals are designed to communicate without any processor control. Generally the processor handles the system control features, such as optics and buttons in a USB mouse, as well as the USB transactions.

And, unless you have an intelligent SIE, there is going to have to be firmware somewhere in your peripheral to communicate at the USB transaction level. Thatýs where the peripheral firmware comes in.

The USB is generally supported on three platforms, Windows98/2k and MacOS, with some limited support on Linux. For the purposes of this article, I will be using a Windows WDM driver. The driver recognizes and becomes attached to your device after you plug the device into the host. The peripheral provides the correct Product ID (PID) and Vendor ID (VID) during the startup process.

The host application opens the driver and sends and receives data from the peripheral. USB devices have a logical communications channel known as endpoint 0, which allows you to send vendor-specific commands to the peripheral. Later, I will present a Win32 dialog application that allows you to send data on endpoint 2 (BULK OUT), receive data on endpoint 1 (BULK IN), and send vendor-specific requests on endpoint 0.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ