Download presentation
Presentation is loading. Please wait.
Published byTerence Gordon Modified over 9 years ago
2
May 8, 20012 The EASY Way to Create I/O Devices John Hyde Intel Corporation john.hyde @ intel.com
3
May 8, 20013 Agenda w WHAT problem are we solving w HOW will we solve this problem w EXAMPLES of solutions using this methodology EXAMPLES WHAT HOW Does this sound useful to you?
4
May 8, 20014 Agenda w WHAT problem are we solving – Recap of Key Concepts – Software Model of I/O Device – I/O Device Responsibilities – “Typical” Implementation – Overall Design Task w HOW will we solve this problem w EXAMPLES of solutions using this methodology
5
May 8, 20015 Recap of Key Concepts USB is a “Single Master + Multiple Slaves” Polled Bus Host PC Hub I/O Device To other devices (including hubs)
6
May 8, 20016 Recap of Key Concepts w USB cable has 4 wires = Power + Ground + 2 Signal Signals in this cable are at 1 of 3 nominal speeds and are Uni-directional, Point-to-Point & Mainly Differential PVC Copper Aluminum
7
May 8, 20017 Recap of Key Concepts w Communication uses PACKETS The “Packet” is a fundamental building block The “Packet” is a fundamental building block IDLE IDLE
8
May 8, 20018 Recap of Key Concepts w There are FOUR packet “types” These differ only in their response characteristics These differ only in their response characteristics CONTROL BULK INTERRUPT ISOCHRONOUS
9
May 8, 20019 Recap of Key Concepts w Communication uses TRANSFERS = Packets Transfers are built using Packets Token OUTOUT ADDRADDR ENDPENDP CRC5CRC5 NACKNACK Data DAT0DAT0 Bytes C R C 16 Data DAT1DAT1 Bytes C R C 16 Data DAT0DAT0 Data Bytes C R C 16 Token ININ ADDRADDR ENDPENDP CRC5CRC5 ININ ADDRADDR ENDPENDP CRC5CRC5 ININ ADDRADDR ENDPENDP CRC5CRC5
10
May 8, 200110 Recap of Key Concepts w Communication uses TRANSACTIONS = Transfers = Packets TRANSACTIONS = Transfers = Packets Transactions are built using Transfers SOFSOF SETUPSETUP DATA0DATA0 ACKACK ACKACK ININ DATA1DATA1 ACKACK ININ DATA0DATA0 ACKACK SOFSOF SOFSOF SOFSOF SOFSOF OUTOUT DATA1DATA1 SOFSOF SOFSOF ACKACK SOFSOF ININ NAKNAK ININ DATA0DATA0
11
May 8, 200111 Recap of Key Concepts w Bus Protocol = Defined Subset (Transactions) USB has a Defined Protocol Layer Administration (USB “overhead”) User Data Transfer StandardCommandsClass/VendorCommandsGet_Device_DescriptorSet_Protocol HID (interrupt) Printer (bulk)
12
May 8, 200112 Recap of Key Concepts w Information is Exchanged using Data Buffers StandardCommands use Descriptors Class/Vendor Commands & Data Movement BYTES are moved back and forth
13
May 8, 200113 Software Model of I/O Device w Configuration = Interfaces = Endpoints Note 1:1 Mapping of Device Driver and Interface Real World I/O Device Config 1 Config 1 Kernel Cntl EndP Cntl EndP IN EndP IN EndP OUT EndP OUT EndP OUT EndP OUT EndP IN EndP IN EndP OUT EndP OUT EndP Interface 1 Interface 2 Configuration 2 Configuration 2 IN EndP IN EndP OUT EndP OUT EndP Interface 1 OUT EndP OUT EndP IF 2 Device Driver 1 Device Driver 2 I/O Manager User Application Program Host PC Data Pipe Control Pipe
14
May 8, 200114 Software Model of I/O Device w Endpoints from the I/O Device’s point of view Endpoints are a KEY abstraction Real World I/O Device Configuration1 Control EndP Control EndP IN EndP IN EndP OUT EndP OUT EndP Control EndP Control EndP OUT EndP OUT EndP Data Pipe Control Pipe FROM Host PC FROM Host PC TO Host PC TO Host PC
15
May 8, 200115 I/O Device Responsibilities FROMHostPCFROMHostPCTOHostPCTOHostPC w 1 = RESPOND to Commands Commands and Responses use Control EP0 Real World I/O Device Configuration1 Control EndP Control EndP IN EndP IN EndP OUT EndP OUT EndP Control EndP Control EndP OUT EndP OUT EndP Data Pipe Control Pipe
16
May 8, 200116 I/O Device Responsibilities w 2 = PREPARE DATA for Host PC Note that Host PC READS (I/O device does not write) Real World I/O Device Configuration1 Control EndP Control EndP IN EndP IN EndP OUT EndP OUT EndP Control EndP Control EndP OUT EndP OUT EndP Data Pipe Control Pipe TO Host PC TO Host PC
17
May 8, 200117 I/O Device Responsibilities w 3 = CONSUME DATA from Host PC Data is typically sent via a Data Pipe Real World I/O Device Configuration1 Control EndP Control EndP IN EndP IN EndP OUT EndP OUT EndP Control EndP Control EndP OUT EndP OUT EndP Data Pipe Control Pipe FROM Host PC FROM Host PC
18
May 8, 200118 I/O Device Responsibilities w 4 = Conserve Power I/O Device is REQUIRED to move to Suspend State Attached Powered Suspended Default Suspended Addressed Suspended Configured Suspended
19
May 8, 200119 “Typical” Implementation This is a “Minimal I/O Device” TransceiverTransceiverSerialInterfaceEngineSerialInterfaceEngineProtocolControllerApplication“firmware”ProtocolControllerApplication“firmware”CustomI/ODevicesCustomI/ODevices D+ D- bytes control Real World I/O Real World I/O
20
May 8, 200120 Overall Design Task w Write USB Protocol Firmware w Design Custom I/O w Write “run-time” Firmware Operation of I/O Device is exactly defined
21
May 8, 200121 EXAMPLES WHAT HOW Agenda w WHAT problem are we solving w HOW will we solve this problem w EXAMPLES of solutions using this methodology Write “firmware” to respond to PC Host commands using the Software Model with the Defined Protocol
22
May 8, 200122 Agenda w WHAT problem are we solving w HOW will we solve this problem – Adding to our minimal I/O device – Using a PC as an I/O device – Overall design task now w EXAMPLES of solutions using this methodology
23
May 8, 200123 Adding to Minimal I/O Device w Wide range of expansion options w Friendly development tools w Display, keyboard and mouse w Single step, breakpoint, trace w Performance monitor/measure w Hard drive? w Printer? This sounds like a PC!
24
May 8, 200124 TransceiverTransceiverSerialInterfaceEngineSerialInterfaceEngineProtocolControllerApplication“firmware”ProtocolControllerApplication“firmware”CustomI/ODevicesCustomI/ODevices D+ D- bytes control Real World I/O Real World I/O Using a PC As an I/O Device Any PC / Laptop will do!
25
May 8, 200125 Using a PC As an I/O Device w Use a USB peripheral (Transceiver + SIE) w Simple solution #1 = I2C dongle (1.1) w Simple solution #2 = Parallel dongle (1.1) w Simple solution #3 = PCI-based card (1.1 or 2.0) w Need to partition the device software
26
May 8, 200126 Using a PC + I2C Dongle Simple, low cost
27
May 8, 200127 Using a PC + Parallel Dongle Simple, higher data rate AD[8:1] nADDRSTBnWAITnDATASTBnWRITEnRESETnINTR D[7:0]A[7:0]RD#WR#RESET#INT# ALE EPPName I/O Device Name
28
May 8, 200128 Using a PC + PCI Add-in Card Simple, supports 480Mbps data rates
29
May 8, 200129 Partitioning the Device S/W And all written in C StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface PortableSoftware HardwareDependantSoftware
30
May 8, 200130 Overall Design Task Now w Write USB Protocol Firmware = DONE w Design Custom I/O w Write “run-time” Firmware w (Port to USB microcontroller or ASIC) Easy USB prototyping!
31
May 8, 200131 EXAMPLES WHAT HOW Agenda w WHAT problem are we solving w HOW will we solve this problem w EXAMPLES of solutions using this methodology PC provides a robust development platform for portable, extensible, testable “firmware”
32
May 8, 200132 Agenda w WHAT problem are we solving w HOW will we solve this problem w EXAMPLES of solutions using this methodology – Keyboard = Simplest example I could think of! – Using custom I/O = “Buttons and Lights” (HID) – Audio using iso transfers – Printer using bulk transfers – USB 2.0 480Mbps example
33
May 8, 200133 Keyboard Example Design/build hardware = DONE Host PC Device PC USB
34
May 8, 200134 Keyboard Example Write USB protocol firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Write “Chapter 9” code Write SIE access code
35
May 8, 200135 Keyboard Example StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Scan device PC keyboard Generate Report on keypress Write run-time firmware = DONE
36
May 8, 200136 “Buttons and Lights” Design/build hardware = DONE Host PC Device PC
37
May 8, 200137 “Buttons and Lights” StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGES from Keyboard Example Write USB protocol firmware = DONE
38
May 8, 200138 “Buttons and Lights” StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Edit Descriptor Tables Listen for Input Reports Drive custom hardware Write run-time firmware = DONE
39
May 8, 200139 Audio Using ISO Transfers Design/build hardware = DONE Host PC Device PC Integrated Sound Card Jump forward 3 slides We will come back to this Audio section The D11 does not support isochronous transfers!! The D11 does not support isochronous transfers!!
40
May 8, 200140 StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement Descriptor Tables Descriptor Tables SIE Interface Custom I/O Interface NO CHANGES from Keyboard Example Audio Using iso Transfers Write USB protocol firmware = DONE
41
May 8, 200141 Audio Using iso Transfers Write run-time firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Edit Descriptor Tables Receive SOF packet Meter out iso data from previous frame Drive sound card
42
May 8, 200142 Printer Using Bulk Transfers Design/build hardware = first use I2C dongle Host PC Device PC Received user data will be displayed on screen NOTE: “Printer” is a generic bulk transfer device
43
May 8, 200143 StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement Descriptor Tables Descriptor Tables SIE Interface Custom I/O Interface NO CHANGES from Keyboard Example Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write USB protocol firmware = DONE
44
May 8, 200144 Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Edit Descriptor Tables Receive bulk packets Copy user data to display Measure throughput Write run-time firmware = DONE
45
May 8, 200145 Test Results 3 KBps Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Edit Descriptor Tables Receive bulk packets Copy user data to display Measure throughput Write run-time firmware = DONE
46
May 8, 200146 Printer Using Bulk Transfers Design/build hardware = next use parallel dongle NOTE: “Printer” is a generic bulk transfer device Host PC Device PC Received user data will be displayed on screen
47
May 8, 200147 Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write USB protocol firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface Need new SIE access code
48
May 8, 200148 Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write run-time firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGE from previous example Measure throughput
49
May 8, 200149 Test Results 0 KBps Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write run-time firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGE from previous example Measure throughput
50
May 8, 200150 Printer Using Bulk Transfers Design/build hardware = next use parallel dongle NOTE: “Printer” is a generic bulk transfer device Host PC Device PC Received user data will be displayed on screen
51
May 8, 200151 Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write USB protocol firmware = DONE StandardCommands Class/ Vendor Commands and User Data Movement DescriptorTables SIE Interface Custom I/O Interface Need new SIE access code
52
May 8, 200152 Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write run-time firmware = DONE StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGE from previous example Measure throughput
53
May 8, 200153 Test Results ~800 KBps Printer Using Bulk Transfers NOTE: “Printer” is a generic bulk transfer device Write run-time firmware = DONE Standard Commands Class/ Vendor Commands and User Data Movement Descriptor Tables SIE InterfaceCustom I/O Interface NO CHANGE from previous example Measure throughput
54
May 8, 200154 USB 2.0 480Mbps Example Design/build hardware = “upgrade” “printer” example Host PC Device PC Received user data will be displayed on screen
55
May 8, 200155 StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface New SIE access code Additional Descriptors for high speed USB 2.0 480Mbps Example Write USB protocol firmware = DONE
56
May 8, 200156 StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGE from previous example Measure throughput NO CHANGE from previous example Measure throughput USB 2.0 480Mbps Example Write run-time firmware = DONE
57
May 8, 200157 Test Results 28,000 KBps StandardCommandsStandardCommands Class/ Vendor Commands and User Data Movement Class/ Vendor Commands and User Data Movement DescriptorTablesDescriptorTables SIE Interface Custom I/O Interface NO CHANGE from previous example Measure throughput NO CHANGE from previous example Measure throughput USB 2.0 480Mbps Example Write run-time firmware = DONE
58
May 8, 200158 Audio Using ISO Transfers Design/build hardware = DONE Host PC Device PC Integrated Sound Card
59
May 8, 200159 StandardCommands Class/ Vendor Commands and User Data Movement DescriptorTables SIE Interface Custom I/O Interface NO CHANGES from Keyboard Example Audio Using ISO Transfers Write USB protocol firmware = DONE
60
May 8, 200160 Audio Using ISO Transfers Write run-time firmware = DONE StandardCommands Class/ Vendor Commands and User Data Movement DescriptorTables SIE Interface Custom I/O Interface Edit Descriptor Tables Receive SOF packet Meter out iso data from previous frame Drive sound card
61
May 8, 200161 EXAMPLES WHAT HOW Agenda w WHAT problem are we solving w HOW will we solve this problem w EXAMPLES of solutions using this methodology Did this sound EASY to you?
62
May 8, 200162 A Special THANK YOU to: www.devasys.comwww.netchip.com
63
May 8, 200163 The EASY Way to Create I/O Devices John Hyde Intel Corporation john.hyde @ intel.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.