1 / 33

USB: Universal Serial Bus

USB: Universal Serial Bus. Prepared for EECS 373 University of Michigan, Ann Arbor. Joe Kaewbaidhoon Alex Motalleb Vishal Joshi. What do we use to connect a device to a computer?. http://best-external-hard-drives.ecoustics.com/d/f/USB-3.0.

fynn
Télécharger la présentation

USB: Universal Serial Bus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. USB: Universal Serial Bus Prepared for EECS 373 University of Michigan, Ann Arbor Joe Kaewbaidhoon Alex Motalleb Vishal Joshi

  2. What do we use to connect a device to a computer? http://best-external-hard-drives.ecoustics.com/d/f/USB-3.0 http://www.prlog.org/11492850-6e23d-dellcomputer.jpg

  3. USB • The most widely used hardware interface for connecting peripheral devices to a computer. http://www.gizmag.com/standard-micro-usb-charger-europe/12108/

  4. History • Developed in the mid 1990’s by  Compaq, DEC, IBM, Intel, Microsoft, NEC, Nortel • Purpose: • Reduce cabling • Reduce type of ports • Simplifying software configuration • More efficient transfers, higher data rates • Versions: 1.0, 2.0, and 3.0

  5. How do we physically connect a device?

  6. Connectors • Single master, up to 127 slaves • Type A (faces upstream) • The connector found on host and hubs • Type B (faces downstream) • The connector found on slave devices • miniA, miniB, and several other types used for smaller devices http://www.beyondlogic.org/usbnutshell/usb2.shtml

  7. Pins/wires • 4 pins • Ground • Vcc: power the devices (5V output from master), note that some devices can draw power from 2 USB ports • 2 data lines (D+ and D-) • Twisted Pair Differential Transmission: If D+ - D- > 200 mV, send ‘1’. If D- - D+ > 200 mV, send ‘0’. • Polarity switches with speed http://en.wikipedia.org/wiki/Usb

  8. J-K state • Polarity switches with speed • J and K are logical states

  9. Once connected, how does the hardware communicate?

  10. Protocol Terms • Hub: • Connects slaves to host (master) • Endpoint:  a logical entity, found on a device. A USB connection may have up to 32 endpoints (16 for master and 16 for slave) in one connections • Pipes: connection from one endpoint to another http://www.gadgetrivia.com/targus_usb_2.0_dvd-rom/cd-rw_slim_external_combo_drive

  11. Endpoint Example http://www.beyondlogic.org/usbnutshell/usb3.shtml

  12. Hardware Initialization • Hub port has status bits • plugged in, status bit = 1 • Idle = 0 • Hub automatically updates when something plugs in • Host polls the status bits • If 1, initializes the hardware and software protocol

  13. Powering a Device with Vcc • Devices can be powered using the Vbus (Vcc) line • Functions divided into three types • Low-power bus powered function • May use up to one unit load (100 mA) • High-power bus powered function • May use up to 5 unit loads (500 mA) after configuration • Self-powered function • May use up to one unit load • Rest of the power supplied by external source

  14. Transfer Speeds on D+ and D- • Low speed = 10-100 KB/s • Used for Human Interactive devices (ex. keyboard, mouse, etc) • Full speed = 500 KB/s – 10 MB/s • Used for audio and compressed video(ex. Microphone) • High speed = 25-400 MB/s • Used for video and storage (ex. Digital camera) USB 1.0 USB 2.0

  15. Drivers • Once the connector is plugged in, the host detects and interrogates it • Loads appropriate driver based on PID/VID (Product ID/Vendor ID) combination • VID provided by USB Implementer's forum for a fee

  16. Once connected and synchronized, how is the software going to facilitate communication?

  17. Hierarchy of Data Transfers

  18. Hierarchy of Data Transfers

  19. Transfers • Control: used for command and status operations • Most common type of transfer • Interrupt: a polling transfer which checks devices for interrupts • Isochronous: continuous, periodic transfers • Generally used for audio or video streaming • Bulk: used for large bursts of data • Example: print-job, scanner image

  20. Hierarchy of Data Transfers

  21. Stages • Typical stage involves three types of packets • Token: Describes what follows, read/write, address of device, designated endpoint • Data (optional): Carries the payload • Low speed – 8 bytes • Full speed – 1023 bytes • High speed – 1024 bytes • Status: reports whether data/token was received, if endpoint stalled

  22. Control Transfer: Setup Stage • Setup Stage: 3 packets – Token, Data0, Ack http://www.beyondlogic.org/usbnutshell/usb4.shtml

  23. Control Transfer: Data Stage • Data Stage: IN or OUT depending on direction of transfer http://www.beyondlogic.org/usbnutshell/usb4.shtml

  24. Control Transfer: Status Stage • Status Stage: IN or OUT depending on direction of transfer http://www.beyondlogic.org/usbnutshell/usb4.shtml

  25. Hierarchy of Data Transfers

  26. Packet Types • Token Packets • In: Host requests read • Out: Host requests write • Setup: Used to begin control transfers • Data Packets • Data0 • Data1 • Handshake Packets • ACK: Successfully received • NAK: Failed to receive (also used during interrupts) • STALL: Host must intervene http://www.beyondlogic.org/usbnutshell/usb3.shtml

  27. Hierarchy of Data Transfers

  28. Packet Fields • Sync: 8-32 bits used to synchronize host clock with device clock • Packet ID (PID): defines the type of packet being sent • Sent as 8 bits -> • ADDR: specifies which device the packet is being sent to • 7 bits for addressing to 127 slaves • Address 0 is invalid http://www.beyondlogic.org/usbnutshell/usb3.shtml

  29. More Packet Fields • ENDP: defines the target endpoint • 4 bits for 16 possible endpoints • Endpoint 0 must exist • CRC: Cyclic Redundancy Checks • 5 bits within token • 16 bits within data • EOP: End of packet

  30. Data Encoding • Uses NRZI (Non Return to Zero Inverted) • Transition -> 0 • No transition -> 1 Adapted from http://en.wikipedia.org/wiki/File:NRZI_example.png

  31. Bit Stuffing • Bit stuffing after 6thconsecutive ‘1’ http://www.eetimes.com/design/embedded/4023950/USB-Debug-Tips

  32. Questions?

  33. References • http://www.nti1.com/usb-prots.html • http://www.usb.org/developers/docs/ • http://www.beyondlogic.org/usbnutshell/usb1.htm

More Related