1USB OverviewThis course serves as an introduction to USB.
1010Transactions A transaction allows a set of operations to be grouped in such a way that they either all succeed or all fail; further, the operatio
1111What is a Transfer? The transfer is the process of making a communications request with an endpoint. Transfers determine aspects of the communic
1212Transfer FormatDataTokenHandshakeDataTokenHandshakeDataTokenHandshakeDataTokenHandshakeDataTokenHandshakeDataTokenPhases (Packets)Guaranteed deli
1313USB Transfers—A Closer Look Control Write Transfers (OUT)—contains Setup, Data (optional), and handshake transactionsSETUPPID=1101DATA0PID=0011AC
1414USB Transfers—Closer Look at a Control Transfer Control Read Transfers (IN)—contains Setup, Data (optional), and handshake transactionsSETUPPID=1
1515USB Transfers—Actual Control Transfer Control Transfer Read Example — GET_STATUS command from HostTransferTransactionPacketHierarchySETUP PhaseDA
1616USB Transfers—Closer Look at Bulk/Interrupt Transfers Bulk and interrupt transfers Contains IN/OUT, Data, and handshake transactions Bulk sched
1717USB Transfers—Actual Interrupt Transfer Bulk/interrupt transfer read example:IN TransactionInterrupt TransferToken PacketData PacketHandshake Pac
1818USB Transfers—Closer Look at an Isochronous Transfer Isochronous transfer Contains IN/OUT and DATA transactions Fixed transfer rate with a defi
1919USB Transfers—Actual Isochronous Transfer Isochronous transfer OUT example:TransferTransactionPacketHierarchyOUT TransactionToken PacketData Pack
22Agenda USB overview USB low level data transfer USB protocol structure USB chapter 9 structure Enumeration Standard classes Firmware example
2020I Have to Know All of This?What part of the low level USB information do I need to be concerned with?The USB transceiver and the Serial Interface
2121Silicon Labs Serial Interface Engine (SIE) Serial Interface Engine (SIE) is part of the USB hardware and handles data communications to the host
2222Different Devices and the Transfers They Use What happens when all of these devices are plugged into the USB? Host manages the bus bandwidth upo
23USB Middle Layer
2424USB—Chapter 9 The enumeration process begins The host initiates a set of communication requests to the device to determine the who, what, and ho
2525Enumeration—Loading Descriptors Enumeration The activity that identifies and assigns unique addresses to devices attached to a bus Makes USB de
2626Enumeration: Finding a Driver Once all descriptors are communicated, the Windows host searches for a driver based on the vendor ID and product ID
2727USB Descriptors Descriptors Data structures, or formatted blocks of information, that enable the host to learn about the device Each Descriptor
2828USB Descriptors Types Device descriptor General info about a USB device (vendor ID, etc) Contains info that applies globally to the device Onl
2929Example Device Descriptor Spec (1 of 2) A look at a descriptor and its fieldsSubclass code (assigned by the USB-IF)These codes are qualified by
33Advantages of USBType A/B MiniMicro Ease of Use One interface for many devices Hot pluggable Automatic configuration No power supply required
3030Number of possible configurationsNumber1bNumConfigurations17Index of string descriptor describing the device’s serial numberIndex1iSerialNumber16I
3131Device Descriptor Example A look at a device descriptor declared in code://---------------------------// Descriptor Declarations//---------------
3232Getting the DescriptorsHow does the host get all of these descriptors from the MCU?The Standard Request. The data passed as part of the Setup pha
3333Standard Device Request Format The host initializes a device through a series of device requests via control transfers to Endpoint 0 These are
3434Standard Requests Values These tables indicate the bRequest values and the wValue values defined by the USB spec From the previous slide it can
3535Standard Request Exercise We are a host and we want to generate a request to a device in order to receive it’s device descriptor What values wou
3636Standard Requests Example Get_Descriptor(DEVICE): Standard request to get the device descriptorbmRequestType = 80h, bRequest = 06h (Get_Descripto
3737USB—Device States (1 of 3) Idle state All drivers are off. Device speed determines Idle state based on the pull-up resistor attached. For full
3838USB—Device States (2 of 3) Resume Any bus activity brings device out of suspend Host places bus in Data K state for 20 mS then low speed EOP R
3939USB—Device States (3 of 3)State diagramThere are different device states defined in the USB specification. Here is a graphical view of the devic
44Some USB TermsHost — computer that controls the interfaceFunction — device that provides a capability to the hostHub — device with one or more conne
4040Device Classes Device classes group common interfaces together Class definitions specify the number and types of endpoints May define data form
4141 HID Class originally developed to for human interface objects such as mice and keyboards Interrupt transfers used for data transport Any devic
4242Mass Storage (MSD) Used for file transfer for memory sticks, etc. Bulk transfers used for data transport What do I need? Firmware side Firmwa
4343Communications Device Class (CDC) Bulk transfers used for data transport Any device can use the CDC drivers. It does not need to be a modem dev
4444Example Class Specific Descriptor Structure*Device Descriptor*Device DescriptorConfiguration DescriptorConfiguration DescriptorCommunications Clas
45USB Firmware
4646USB Firmware Descriptor Variable DefinedDevice Descriptor StructuresHere is a snapshot of some sample code that implements USB. On the left are t
4747Code Flow—One ExampleISR generated whenever USB event occursParse the ISR to determine USB eventHandle_Setup RoutineUSB ISR RoutineData that gets
4848What is Required and Where to Get Help Requirements Vendor ID—obtained from the USB Forum See following slide about how Silicon Labs can help
49USB Solutions Offered by Silicon Labs
55What is USB? Serial protocol—strictly defined frame and packet based protocol with error checking and handshaking. LSB in first, MSB last. Half D
5050Certification and Compliance Testing Silicon Labs allotment system Silicon Labs has a unique VID (0x10C4) If a customer uses the Silicon Labora
5151Silicon Labs USB MCU Products Mixed-Signal USB 2.0 MCU solutions 48 MIPS core, 10-bit 200 ksps ADC, timers, comparators, UART, EMIF On-chip osc
5252Highly Integrated USB MCUs High-speed 8051 core up to 48 MIPS Up to 64Kb Flash and 4K RAM for application code Complete 2.0 USB feature set I
5353Most Powerful Mixed-Signal USB MCUHigh-speed 8051 core operating up to 48 MIPSUp to 64 kB Flash and 5376B of RAM17 ch. 10-bit, 200 ksps ADCIn-syst
5454Single-Chip USB to UART Bridge CP210x family of devices Fixed function USB to UART bridges provide the easiest method for upgrading legacy RS-23
5555Single-Chip CP2103 USB to UART BridgeUART I/F(Modem)VBUSD–D+CP2103Voltage RegulatorUSB Function Controller1024 BEEPROMUART48 MHzOscillator640 BTX
5656USB Software Support Fixed-function Support Software Full royalty-free driver support for Windows, MAC OS, and Linux WHQL certified MCU Suppor
5757USBXpress—Features General USBXpress information Implements a bulk pipe between host and peripheral Operates at full speed using bulk transfers
5858USB Development Solutions Evaluation kits for USB/UART bridge CP2102EK, CP2103EK VCP Driver CD included Full development kits for Flash-based
5959Learn More at the Education Resource Center Visit the Silicon Labs website to get more information on Silicon Labs products, technologies and too
6USB Lower LayerIn this course serves as an introduction to USB.
60AppendixAn Actual CDC Class Enumeration & Data Transfer Example
6161EnumerationTabular form of what we listed in our device descriptor structure. Note the bDeviceClass is recognized as CommunicationHost sends Get_
6262Get_Descriptor (Device)Remember our exercise slide 35?We parsed the data and returned the device descriptorStatus phase terminating the transfer
6363Passing the Config Descriptor (1 of 2)Data toggle in action — our max packet size is 64 bytes. Our config descriptor is 67 bytes so we need multi
6464Passing the Config Descriptor (2 of 2)The data shown corresponds to the data set-up in the USB_DESCRIPTORS.cfile. It is transferred in response t
6565More EnumerationWhy the red X? We broadcast USB 2.0 compliant so this request is to find out if the device supports an other speed. We don’t so
6666USB Setting the Baud RateWhen we set HyperTerminal to the baud rate and selected “Connect”, the driver sends the device a command to set its UART
6767We Use Our Bulk EndpointsBulk OUT transfers to send the keys we hit. This example shows “hello” being typed.Now that the communications link is e
68www.silabs.com/MCU
77Attach Event Plugging in a USB device to the host root hub or external hub is considered an attach event. The device has a 1.5 KΩ pull-up resistor
88Packet Identifiers (PID) The PID signals to the receiver that what the packet structure and content will be and how the receiver has to respond0010
99Packets Packets—block of information with a defined data structure. The packet is the lowest level of the USB transfer hierarchy describing the phy
Comentários a estes Manuais