USB for Embedded Devices Mohit Maheshwari 200601008 Prashant Garg 200601144
USB : An Introduction The Universal Serial Bus (USB) is a specification developed by Compaq, Intel, Microsoft and NEC, joined later by Hewlett-Packard, Lucent and Philips. These companies formed the USB Implementers Forum, Inc.
The need for USB Laborious and error-prone configuration of the RS-232 port. Incompatible RS-232 connectors. High Power requirements of the transceivers. Point-to-Point nature of the connections , thus sharing among multiple devices meant a lot of cable and connector requirements.
The Evolution of USB USB 1.0: January 1996. Specified data rates of 1.5 Mbit/s and 12 Mbit/s. Had many limitations , wasn’t widely adopted USB 1.1: September 1998. Fixed bugs of earlier version, was widely accepted. USB 2.0: April 2000. Added Speed of 480 Mbit/s USB On-the-Go: December 2006. Host not needed any more. Micro USB: April 2007.Specially for Mobile Phones USB 3.0: (5 Gbit/s) In pipeline. Expected to be commercially available in 2010.
Architecture Tiered Star Topology. Can connect to a maximum 127 devices. Maximum number of tiers permitted is 6. Length of cable limited to 5m.
The Concept of HOST!! HOST is master Devices can’t communicate directly Host Device 1 Device 2
USB Host Types Intel developed the UHCI (Universal Host Controller Inter-face) specification. More Software Oriented Version. A team led by Compaq, Microsoft, and National Semiconductor came out with the OHCI (Open Host Controller Interface) specification. More Hardware Oriented Version. With the introduction of the high-speed data rate of USB Version 2.0, all of the participants agreed to the EHCI (Enhanced Host Controller Interface) specification.
USB On the Go Device 1 Device 2 Devices can become limited role hosts Marked the emergence of usage of USB in portable platforms Removed the often-cited limitation that USB requires a desktop computer or equivalent to act as a host.
Cables and Connectors Type- A Type-B mini-B-Type mini-A-Type micro-AB-Type
Cable Types A high/full speed detachable cable with 1. one end terminated with an A plug and the other end with a B or mini-B plug. A captive high/full speed cable where 2. one end is hardwired to the vendors equipment and the other end is terminated with an A plug.
Device Powering A device (or hub) can only sink (consume) current from its upstream port and source to downstream port. A device which draws its power from the bus is called a 'bus-powered' device. It relies solely on the USB cable. A 'self-powered' device is one which does not draw power from the bus. An additional power cable is attached. Note : USB Connectors are specially designed with power pins longer than signal pins so that power is always applied before signals.
Anatomy of a Packet Packet, the fundamental element of communication on USB Bus
The Fundamental Packet SYNC sequence used by receiver to tune its clock with the transition of the received data. It is of 8 bits. Packet information varies from 1 to 1025 bytes. First byte, Packet Identifier (PID) defines how other information bytes should be interpreted. Presently there are 10 defined PID types The last part of a packet is the End-of- packet identifier.
Data Transfer Once powered up, host queries all the devices connected to the bus and assigns each one an address. This process is called Enumeration . Host also enquires what type of data transfer is the device wishing to perform: Interrupt (For mouse or keyboard) Bulk (For printer) Isochronous (Streaming devices like Speaker)
USB on Embedded Systems Any embedded device with a processor has a potential to act as a USB host. Potential Embedded platforms: Cell Phones PDAs Digital Cameras Set top Boxes and more …….
Challenges of implementing USB on an embedded platform USB on a PC USB on an embedded device MB and GB of memory Only KB of memory available available 2 GHz micro-processor 12-33 MHz Processor Hard drive space in GB , No hard drive at all greater than 100 GB now a days Last but not the least, many USB on embedded systems skilled engineers are well is relatively new and not versed in designing PC based many people have an idea USB applications about it.
But there is a silver lining!! New updates to incorporate USB on embedded platforms include: Modern embedded devices allow alternative connection strategies. Lowered host power requirements. 480-Mbps data rate.
USB 1.1 vs Serial vs Parallel
USB interfacing with Microcontroller Few years back, migrating to USB was difficult pertaining to higher costs. New MCUs with native USB interfaces offer a better solution
USB interfaced with Microcontroller Latest architectures include direct integration of the USB interface and transceiver with the MCU core. This allows the application to take full advantage of the bus potential. Due to large amounts of flash program memory on chip, MCUs with native USB interfaces can manage the entire application in a single-chip USB. This results in an effective component count reduction and overall real system cost savings.
Linux Based USB Devices Write custom Linux kernel module . Provides the power to do sophisticated things like emulating a file system etc. Use USB bus as a high speed serial port . Implemented in the Linux kernel for Strong ARM processors. Straightforward approach and mostly used. Ethernet over USB. Linux has modules to implement both the host and device sides of this capability. The Linux kernel for the iPAQ uses this, since the iPAQ hardware has neither an accessible serial port nor a dedicated network interface. Note: Correct approach depends on how much time one wants to spend in development and how we want our embedded application to use the USB interface.
Why Linux for using USB? Linux not only contains drivers for host controllers, but for device controllers as well. These controller drivers enable Linux- based embedded systems to use USB to communicate with a host computer (which may or may not be running Linux as well). USB communications under Linux are flexible and easy to use.
USB: The Road Ahead Micro USB has recently arrived in market. Same port for charging and wired connectivity. Caters to the demands of the reducing size of devices. USB 3.0
References Jan Axelson, USB Complete Everything You Need to Develop Custom USB Peripherals, 3 rd edition John Hyde, USB Design by Example A Practical Guide to Building IO Devices, 2nd Edition Datasheets – ATMega32, ATMega32U4, FT232 http://www.embedded.com http://www.usbmadesimple.co.uk/ http://www.everythingusb.com/ http://www.embedded-computing.com/ http://www.lvr.com/usb.htm
Thank You !!
Recommend
More recommend