USB 2.0   INTRODUCTIONNTUT CSIE
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
Key WordDown : From host to deviceUp : From device to hostExampleDown stream : data flow from host todeviceUp stream : dat...
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
HistoryUSB—Universal Serial BusInvented and standardized by a groupof computer and peripheralsmanufactures in 1995Compete ...
Evolution
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
Characteristic (1) Connection of the PC to the telephone :  =>In order to transmit data Ease-of-use :  =>Support plug and ...
Characteristic (2)The logical topology of the USB is a starstructureIt is similar to computer networkThe USB uses a pollin...
USB Can DoCombines low speed and high speedbus activity , USB enables sharedaccess for both speedAutomatic configuring of ...
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
USB System Member (1)Host : only one=>The smartest element in the USB system=>Responsible to the complexity of the  protoc...
USB System Member (2)Hub : one or more=>Like the hubs used for computernetwork=>Enables many devices to connect to   a sin...
USB System Member (3)Device : one or more=>Everything in the USB system , which is  not a host , is a device ( include hub...
Typical Application
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
Communication Flow
Pipes (1)The logic communication between the clientsoftware on the host and the function on thedevice is done through pipe...
Pipes (2)An endpoint is the source or destination ofthe data that transmitted on the USB cableTwo direction=>OUT :   data ...
The Physical Layer
Signaling On The BusThe USB cable is 4 wire cableSignal on the bus is done by signalingover tow wires ( D+ and D_ )=>1 : D...
SIESIE : Serial Interface EngineIt is part of both the host’s and thedevice’s physical layer=>Serialization and Deserializ...
HCHC : Host Controller=>It is an additional hardware to ensure   that everything which is transmitted   on the bus is corr...
The Protocol EngineLayer
This Layer HandlesResponsible for the translating the databetween the application layer and theUSB transactions protocol ....
The USB System SWCompose of The Host Controller Driverand The USB DriverResponsible for=>Bandwidth allocation=>bus power m...
The USB Logical DeviceCompose of a collection of independentendpointsEach endpoint has an unique EndpointNumber and is uni...
The Application LayerHost end : Client Software= >Manages the appropriate interface by   transferring data from its buffer...
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
TransactionUSB transactions are done throughpackets include three phases=>Token phase : host initiates token   indicating ...
Transfer Types (1)Control Transfer=>Used to configure a device (enumeration)=>Compose of three phases (setup,data,status)I...
Transfer Types (2)Bulk Transfer=>Used for large burst data=>Guarantee of delivery , no guarantee of    bandwidth or minimu...
Packet (1)PID : Packet Identifier FieldAddress Field=>So , there are up to 127 devices in USB
Packet (2)Token Packet=>ADDR & ENDP define an unique endpoint
Packet (3)Data Packet
Packet (4)Handshake Packet=>Such as ACK 、 NAK 、 STALL…etc.
OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
ConclusionUSB is powerful and easy to useThe complex host make the deviceeasy to design
The   End        Thanks
7 Level
Hub (1)Detecting an attachment and detachmentof devicesHandling the power management for devicethat are bus-poweredRespons...
Hub (2)
Device Category (1)By speed=>High-speed : work in 480 MB/S=>Full-speed : work in 12 MB/S=>Low-speed : work in 1.5 MB/SBy p...
Device Category (2)By number of functions=>Compound device=>Composite device
Device Category (3)
Device Category (4)
PIPE
Cable
NRZI (1)Want to transmit :=>1 : without changing the level of the      level of the signaling=>0 : flip the value of the d...
NRZI (2)Problem :When we send “1” stream , the transmissionline will stay static ( no change period )Solution :“Bit stuffi...
HC HandlesFrame Generation :=>Partition time units (each one is 1msec as   a frame)Data Processing :=>Handles the request ...
HCD && USBDUCD :=>An interface to the host controllerUSBD :=>Handle IRPS(I/O Request Packets) from  client software=>Handl...
Tree Phase
Control Transfer
Isochronous Transfer
Bulk Transfer
Interrupt Transfer
Upcoming SlideShare
Loading in …5
×

Usb

822 views

Published on

USB protocol tutorial.

Published in: Education
  • Be the first to comment

  • Be the first to like this

Usb

  1. 1. USB 2.0 INTRODUCTIONNTUT CSIE
  2. 2. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  3. 3. Key WordDown : From host to deviceUp : From device to hostExampleDown stream : data flow from host todeviceUp stream : data flow from device tohost
  4. 4. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  5. 5. HistoryUSB—Universal Serial BusInvented and standardized by a groupof computer and peripheralsmanufactures in 1995Compete with IEEE1394
  6. 6. Evolution
  7. 7. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  8. 8. Characteristic (1) Connection of the PC to the telephone : =>In order to transmit data Ease-of-use :  =>Support plug and play Port expansion : =>Up to 127 devices  =>Can add lots of device to a XX
  9. 9. Characteristic (2)The logical topology of the USB is a starstructureIt is similar to computer networkThe USB uses a polling protocolUp to 7 level
  10. 10. USB Can DoCombines low speed and high speedbus activity , USB enables sharedaccess for both speedAutomatic configuring of devices and aserial bus which is simplified and easyto plug intoAttach / detach easily without restartingsystem
  11. 11. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  12. 12. USB System Member (1)Host : only one=>The smartest element in the USB system=>Responsible to the complexity of the protocol to make devices design simple and low cost=>Control the media access ( no one can access the bus unless it get an approval required from the host )
  13. 13. USB System Member (2)Hub : one or more=>Like the hubs used for computernetwork=>Enables many devices to connect to a single USB port
  14. 14. USB System Member (3)Device : one or more=>Everything in the USB system , which is not a host , is a device ( include hubs)=>A device may provides one or more USB functions=>Has an unique address at the end of the enumeration process
  15. 15. Typical Application
  16. 16. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  17. 17. Communication Flow
  18. 18. Pipes (1)The logic communication between the clientsoftware on the host and the function on thedevice is done through pipesIt is a association between a specificendpoint on the device and the appropriatesoftware in the host
  19. 19. Pipes (2)An endpoint is the source or destination ofthe data that transmitted on the USB cableTwo direction=>OUT : data flows from the host to the device=>IN : data flows from the device to the host
  20. 20. The Physical Layer
  21. 21. Signaling On The BusThe USB cable is 4 wire cableSignal on the bus is done by signalingover tow wires ( D+ and D_ )=>1 : D_ low , D+ high=>0 : D_ high , D+ lowData encoding and decoding is doneusing NRZI ( Non Return to ZeroInverted )
  22. 22. SIESIE : Serial Interface EngineIt is part of both the host’s and thedevice’s physical layer=>Serialization and Deserialization=>Encoding and Decoding=>Generate(for out) and Verify(for in)CRC=>Detect PID
  23. 23. HCHC : Host Controller=>It is an additional hardware to ensure that everything which is transmitted on the bus is correct=>It serves both the USB and the host and has the same functionality inever USB system
  24. 24. The Protocol EngineLayer
  25. 25. This Layer HandlesResponsible for the translating the databetween the application layer and theUSB transactions protocol .Two Role=>USB System Software (in the USBhost)=>USB Logical Device (in the USBdevice)
  26. 26. The USB System SWCompose of The Host Controller Driverand The USB DriverResponsible for=>Bandwidth allocation=>bus power managementTwo of above are in order to enabledevices to access the bus
  27. 27. The USB Logical DeviceCompose of a collection of independentendpointsEach endpoint has an unique EndpointNumber and is unidirectional(exceptendpoint zero and has two type--In/Out)Default pipe is associated with endpointzero
  28. 28. The Application LayerHost end : Client Software= >Manages the appropriate interface by transferring data from its buffers to the endpoint with the appropriate interfaceDevice end : Function= >Composed of interfaces and controls the functionality of the device
  29. 29. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  30. 30. TransactionUSB transactions are done throughpackets include three phases=>Token phase : host initiates token indicating the future transfer type=>Data phase : actual data transmitted=>Handshake phase : indicate thesuccess or failure of the transaction
  31. 31. Transfer Types (1)Control Transfer=>Used to configure a device (enumeration)=>Compose of three phases (setup,data,status)Isochronous Transfer=>Used for multimedia devices=>It is guarantee the required bandwidth=>No handshake phase
  32. 32. Transfer Types (2)Bulk Transfer=>Used for large burst data=>Guarantee of delivery , no guarantee of bandwidth or minimum latencyInterrupt Transfer=>If there is a pending interrupt , the function will send details to host after host poll it
  33. 33. Packet (1)PID : Packet Identifier FieldAddress Field=>So , there are up to 127 devices in USB
  34. 34. Packet (2)Token Packet=>ADDR & ENDP define an unique endpoint
  35. 35. Packet (3)Data Packet
  36. 36. Packet (4)Handshake Packet=>Such as ACK 、 NAK 、 STALL…etc.
  37. 37. OutlineHistory and EvolutionWhy We Need USB ?Architectural OverviewUSB communication flowProtocol LayerConclusion
  38. 38. ConclusionUSB is powerful and easy to useThe complex host make the deviceeasy to design
  39. 39. The End Thanks
  40. 40. 7 Level
  41. 41. Hub (1)Detecting an attachment and detachmentof devicesHandling the power management for devicethat are bus-poweredResponsibility for bus error detection andrecoveryManage both full and low speed devices
  42. 42. Hub (2)
  43. 43. Device Category (1)By speed=>High-speed : work in 480 MB/S=>Full-speed : work in 12 MB/S=>Low-speed : work in 1.5 MB/SBy power supply=>Self powered=>bus powered
  44. 44. Device Category (2)By number of functions=>Compound device=>Composite device
  45. 45. Device Category (3)
  46. 46. Device Category (4)
  47. 47. PIPE
  48. 48. Cable
  49. 49. NRZI (1)Want to transmit :=>1 : without changing the level of the level of the signaling=>0 : flip the value of the differential pairexample :
  50. 50. NRZI (2)Problem :When we send “1” stream , the transmissionline will stay static ( no change period )Solution :“Bit stuffing” , performed before the NRZIexample :data : 010111111101send : 0101111110101
  51. 51. HC HandlesFrame Generation :=>Partition time units (each one is 1msec as a frame)Data Processing :=>Handles the request for data to / from the hostError Handling :Such as Timeout 、 CRC error 、 Unexpecteddata payloadRemote wakeup
  52. 52. HCD && USBDUCD :=>An interface to the host controllerUSBD :=>Handle IRPS(I/O Request Packets) from client software=>Handle enumeration process , so it owns default pipe (initial pipe)
  53. 53. Tree Phase
  54. 54. Control Transfer
  55. 55. Isochronous Transfer
  56. 56. Bulk Transfer
  57. 57. Interrupt Transfer

×