1 / 123

Tìm hiểu giao tiếp USB

Tìm hiểu giao tiếp USB. Bài giảng sư ̉ dụng tài liệu của sinh viên khóa trước. Nội dung. Introduction. USB là một chuẩn kết nối của máy tính . Ra đời năm 1996 (1.0) Là kết quả của sự hợp tác giữa 7 công ty hàng đầu thế giới

ramla
Télécharger la présentation

Tìm hiểu giao tiếp USB

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. Tìmhiểugiaotiếp USB Bàigiảngsử dụngtàiliệucủasinhviênkhóatrước

  2. Nội dung

  3. Introduction

  4. USB là một chuẩn kết nối của máytính. • Ra đờinăm 1996 (1.0) • Làkếtquảcủasựhợptácgiữa 7 côngtyhàngđầuthếgiới • Compaq, Digital Equipment Corporation, IBM, Intel, Microsoft, NEC, Northern Telecom Introduction

  5. Introduction

  6. Introduction • Tốc độ trên lý thuyết : • USB 1.0: 1,5 Mbps (low speed) • USB 1.1: 12 Mbps (full speed) • USB 2.0: 480 Mbps (high speed) • USB 3.0: 4,8 Gbps (super speed) Introduction

  7. Cấu tạo Introduction

  8. Ưuđiểm: Hỗ trợ nhiều kết nối khác nhau USB INTERFACE Sound RS232 VGA Ethernet Introduction

  9. Ưuđiểm: • Tựcấu hình: tự load driver khikếtnốithiếtbịngoại vi với PC – khôngcần reset máysaukhicài driver Insert driver disk Plug & Play First time Next time Introduction

  10. Ưuđiểm: • Dễ kết nối các thiết bị vào cổng USB • Đa số máy tính hiện nay có nhiều cổng USB, ngoài ra còn có các loại HUB USB. • USB mở rộng tới 127 thiết bị có thể kết nối cùng vào một máy tính trên một cổng USB duy nhất (bao gồm các hub USB) Introduction

  11. Bêncạnhđó, USB tiệnlợihơncácđầucắmkhác do kíchthướcnhỏ, cóthểtháovàcắmnóngthiếtbịmàkhônghềtổnhạiđến PC • USB cũnghỗtrợkếtnốikhôngdâygiữa PC vàthiếtbị • Với HUB, khoảngcáchdâygiữa PC và device cóthểlêntới 30m • Khôngcầnthiếtlậpcàiđặtcaochothiếtbị (port address…) VS Introduction

  12. Ưuđiểm: • Multiple speeds: • SuperSpeed (USB 3.0) 5 Gbps • High speed: 480 Mbps (USB 2.0) • Full speed: 12 Mbps, low speed: 1.5 Mbps (USB 1.x). • Cho phépchọntốcđộphùhợpvớiứngdụng. • Độ an toàn: cả phần cứng và giao thức sử dụng cho USB đều thề hiện sự an toàn cho dữliệu: có khả năng khửnhiễu, phát hiện vàsửa lỗi khi chuyển dữliệu. • Khôngtốnkém: thực tế cho thấy các thiết bị với giao tiếp USB ngày nay có giá thành ngày càngrẻ. • Tiếtkiệmnănglượng, côngsuấttiêuthụthấp… $$$$$$$$$$ Introduction

  13. Hạnchế: • Giới hạn về khoảng cách (< 5m without hub) • Không hỗ trợ kết nối peer to peer (do USB yêu cầu phải có PC – host controller hardware và device controller hardware) và broadcasting • Không tương thích với phần cứng và hệ điều hànhcũ (không có port USB hoặc ko hỗ trợ driver) Introduction

  14. The Electronic and Mechanical Interface

  15. Mechanical

  16. USB 1.x/2.0 standard pinout The Electronic and Mechanical Interface Mechanical

  17. USB 1.x/2.0 standard pinout The Electronic and Mechanical Interface Mechanical

  18. USB 1.x/2.0 Mini/Micro pinout The Electronic and Mechanical Interface Mechanical

  19. Mini USB Mini-A Mini-B The Electronic and Mechanical Interface Mini-AB Mechanical

  20. Micro USB Micro B The Electronic and Mechanical Interface Mechanical

  21. Micro USB • Cổng Micro-USB được thiết kế để chịu được tối đa 10000 lần rút ra cắm vào • USB chuẩnchỉđượcthiếtkếcho 1500 lầnvà Mini-USB cũngchỉđượcthiếtkếtốiđa 5000 lầnrútracắmvào The Electronic and Mechanical Interface Mechanical

  22. eSATAp (eSATA/USB) combo port The Electronic and Mechanical Interface Mechanical

  23. USB 3.0 pinouts The Electronic and Mechanical Interface Mechanical

  24. Cấu tạo chuẩn A USB 3.0 Mechanical

  25. Cấu tạo chuẩn B USB 3.0 Standard B Micro B Mechanical

  26. Electrical The Electronic and Mechanical Interface

  27. Low speed và full speed Full speed device Low speed device The Electronic and Mechanical Interface

  28. Low speed và full speed • Mức logic của tín hiệu phụ thuộc vào tốc độ. Vì thế người ta dùng ký hiệu J và K để chỉ mức logic • Low speed: J = 0; K = 1 • High speed: J = 1; K = 0 The Electronic and Mechanical Interface

  29. Low/full-speed signaling levels The Electronic and Mechanical Interface

  30. Low/full-speed signaling levels The Electronic and Mechanical Interface

  31. Electrical The Electronic and Mechanical Interface

  32. Electrical The Electronic and Mechanical Interface

  33. High speed • Tốcđộ 480MHz đượcchọnvì • Phùhợpvớicôngnghệvàothờiđiểmđó cóthểsửdụngcáccổngvàcápcũ • Đặcbiệt 480 làbộisốcủa 12 nêncóthểsửdụngchungthạchanhchocácchếđộ • Giáthànhrẻ • Thiếtbị high speed sẽkếtnốibằng full speed sauđó reset và test nếu hub hỗtrợkếtnối 2.0 sẽkhởitạokếtnối • Khihoạtđộng ở high speed điệntrở pull up sẽđượctắtđểcânbằngđườngdây • Thiếtbịtươngthích USB 2.0 khôngnhấtthiếtphảihỗtrợ high speed • Thiếtbịdùng high speed khôngđchỗtrợchếđộ low speed. Nóchỉđượchỗtrợ full speed đểkếtnốilúcđầu, sauđóchuyển qua high speed • Thiếtbị downstream tươngthích USB 2.0 (Hub/Host) phảihỗtrợcả 3 chếđộ high speed, full speed và low speed The Electronic and Mechanical Interface

  34. High speed The Electronic and Mechanical Interface

  35. High speed The Electronic and Mechanical Interface

  36. Transfer BasicElements of a TransferUSB 2.0 TransactionEnsuring successful Transfer Inside USB transfer

  37. Mục tiêu: • Quyết định được loại transfer nào một device nên dùng • Viết firmware cho device • Nhậnbiếtđượccáclỗixảyratrongkhitruyềnthông • Inside a USB transfer

  38. Transfer Basics • Mọi phiên truyền thông USB đều diễn ra với một bên là Host và một bên là Device. • Host quảnlýviệctruyềnthôngtrên Bus và Device đápứngyêucầutừ Host HOST DEVICE • Inside a USB transfer

  39. Transfer Basics • Endpoint: • Endpoint có: • Mã số • Hướng • Dung lượngtốiđacóthểgửi hay nhận HOST DEVICE • Inside a USB transfer

  40. Transfer Basics Transaction: 1 : Token HOST DEVICE 2 : Data 3 : Handshake • Inside a USB transfer

  41. Transfer Basics Transfer: Transfer Transaction Transaction Transaction • Inside a USB transfer

  42. Transfer Basics Summary Transfer Transaction Transaction Transaction Token Data Handshake • Inside a USB transfer

  43. Transfer Basics • Thựctiễn: nhiềuthiếtbịdùngchuẩn USB nhucầukhácnhauđòihỏihỗtrợnhữngkiểu transfer khácnhau • Có 4 loại transfer: • Control: Nhậndạngvàcấuhình • Bulk: Printer, scanner • Interrupt: Chuột, bànphím • Isochronous: Audio và Video streaming • Inside a USB transfer

  44. Transfer Basics • Truyềnthông USB gồm 2 giaiđoạn: • Nhậndạngvàcấuhìnhthiếtbị (Enumeration) • Truyềnthông (tuỳmụcđích) • Chuẩn USB 2.0 hỗtrợtruyềnthông: • Low Speed: 1.5Mbps • Full Speed: 12 Mbps • High Speed: 480 Mbps • Inside a USB transfer

  45. Transfer Basics • USB 2.0 Host Controller chiathông tin thànhnhữngFrame với: • Low và Full Speed: frame 1ms • High Speed: microframe 125 us • Chúngtacóthểxemtừng frame nhưlà “bus interval” • Nhữngtransactions trongmột transfer cóthểnằmgọntrong 1 (micro) frame hay nhiều (micro) frame. • Inside a USB transfer

  46. Elements of Transfer • Endpoints : • Tấtcảdữliệuchạytrên Bus đềuđếnhoặcđitừ device endpoints. Endpoint làmột buffer lưutrữnhiều bytes. Dữliệulưutrên endpoint làdữliệunhậnđược (từ host) hay làdữliệusắptruyền (đến host). • Địachỉ endpoint gồmmãsố endpoint (từ 0-15) vàhướng (theoquanđiểmcủa host). • Endpoint đượccấuhìnhcho control transfer phảitruyềndữliệutừ 2 hướng, vàmỗi device phảicó endpoint 0 đượccấuhìnhcho control endpoints • Inside a USB transfer

  47. Elements of Transfer • Nhữngloại Transaction: • + Ở mọi USB 2.0 transaction, ban đầu host sẽgửimột “addressing – tripple” baogồm: địachỉthiếtbị, mãsố endpoint vàhướng endpoint. • + Khinhận 1 gói tin OUT hay setup, endpoint sẽlưu data theosaugói tin đó, sauđó device hardware sẽsinhrangắt. Tươngtựkhigửigói tin IN. • Inside a USB transfer

  48. Elements of Transfer • Pipes : • Trướckhi data đượctruyềnđi, giữa host và device phảithiếtlậpmột pipe. Host thiếtlập pipe ở quátrình enumeration. Host cóthểyêucầuthêmhoặcbớt pipes dùng control transfer. • Nhắclại: Mọithiếtbịcómột control pipe mặcđịnhdùng endpoint 0. • Thông tin cấuhình host nhậntừ device baogồmmột endpoint descriptor chomỗi endpoint mà device muốndùng. Mỗi endpoint chứađựng: địachỉ endpoint, loại transfer mà endpoint hỗtrợ, kíchthướctốiđagóidữliệu, đôikhicócả transfer interval. • Inside a USB transfer

  49. USB 2.0 Transaction • Inside a USB transfer

  50. USB 2.0 Transaction • Inside a USB transfer

More Related