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

HOW DOES IT WORK?

Now that I have gone into more than enough detail, itýs time to step back and get the 10,000ý view. If you abstract the functionality of the microcontroller, then the view will look something like Figure 5. You have data and control information coming in and out of the USB microcontroller, which appears as a simple data-exchanging device. Data coming from the USB host is passed through the CY7C64013 microcontroller and read by the embedded processor.

Figure 5ýHere you can see the big picture. Note that you can abstract the specific nature of USB and just leave the data-passing interface. This is what your embedded processor should see.

 

Likewise, when the embedded processor writes a byte to the CY7C64013 microcontroller, it is transferred to the USB host. Timing information for the CS#, STB#, OE#, LEMPTY#, and DREADY# signals can be found in the CY7C64013 datasheet (see Resources). Figures 6 and 7 show the relative timing of the HAPI read and write sequences.

The central microprocessor may optionally read the CONNECTED# signal (port3[2]) from the microcontroller to determine if the data written to the microcontrollerýs HAPI will be transferred anywhere, but this still does not require any knowledge of the USB. In effect, the central microprocessor does not need to know anything about USB to aptly handle USB; and with an interface similar to a 16550 UART, itýs almost a drop in replacement! The protocol that you have already developed for your product can remain in place without modification.

One requirement of my original design enabled the USB host to reset the peripheral. The CY7C64013 already has a power-on reset circuit built in, so the ability to control the pins at port[1:0] allowed me to pick a pin and use it as a POR pin. Because of the built-in 14-kilohm pull-up resistor, you can also use these pins in parallel with open-drain POR circuits that may be in your system already. Need both polarities of POR? No problem, use both pins.

The port1[2:0] pins allow you to attach buttons or status pins from your system and have the USB host read these values. For instance, if you want to wait for the embedded processor to boot before sending any data down the USB pipe, you could monitor a pin on the processor from the host. These pins are in a high-impedance state, so you would need to provide a pull-up resistor for switches or use port3[1:0] as pull-up resistors. Feel free to be creative.

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