Introduction to USB
Agenda Introduction to USB LPC23xx Block diagram MCB2300 demo 2
Introduction to USB Plugging the USB cable Communication flow Lets talk about USB applications 3
USB- A Brief History USB 1.1 USB 2.0 OTG Approved on 11/23/99 Original USB 2.0 Supplements the by the USB Core team 2.0 specification released 12 Mbps bus specification on April 27, 2000 Full-speed (12 Mbps) Connects 480 Mbps bus peripherals Low-speed (1.5 Mbps) High-speed (480 Mbps) directly to each Standard A connector other (peer to peer) Full-speed (12 Mbps) and standard B connector New mini-A Low-speed (1.5 Mbps) connector and mini- Interrupt (OUT) Backward compatible AB receptacle Transfer was added with USB 1.1 New mini-B connector 4
Plugging the USB Cable Bus enumeration – The process of identifying and configuring USB devices During enumeration: – Assigning an address – Reading “Descriptors” from device – Assigning and loading a device driver Host software responsibility 5
Descriptors Data Structure with a defined format that enables a host to learn about a device and its capabilities. Device Descriptor Configuration Descriptor Interface Descriptor Interface Descriptor Endpoint Descriptor Endpoint Descriptor Endpoint Descriptor Endpoint Descriptor 6
Introduction to USB Plugging the USB cable Communication flow Lets talk about USB applications 7
IN and OUT Transactions Data flows IN and OUT with HOST respect to the host “IN Transaction” “OUT Transaction” IN OUT 8
Endpoint Explained An endpoint is a buffer used to transmit or receive data Each endpoint has a direction and an address Up to 32 (16 pairs) endpoints can reside within a device Although a host has buffers, it does not have endpoints 9
Introduction to USB Plugging the USB cable Communication flow Lets talk about USB applications 10
USB Applications Interrupt Transfer Control Bulk Transfer Transfer (Bus Enumeration) Isochronous Transfer 11
Interrupt Transfer (1) Device never interrupts the host. Host polls the device Only way low speed devices can transfer data Also used by the host to send data to the device on a scheduled basis Maximum packet size: 1-64 12
Interrupt Transfer (2) DATA STAGE 13
Bulk Transfer (1) Used for large amount of data Only full and high-speed devices Host controller ensures that bulk transfer are eventually completed but it does not guarantee bandwidth Fastest transfer type on an otherwise idle bus Maximum packet size: 8,16,32,64,512 14
Bulk Transfer (2) DATA STAGE 15
Isochronous Transfer (1) Fixed number of bytes per frame. Bandwidth is guaranteed No error correction – No ACK field Used for continuous communication of time- relevant information (streaming data) Full and high-speed devices only Maximum Packet size: 1-1023 16
Isochronous Transfer (2) No ACK field DATA STAGE 17
Control Transfer (1) Enables the host to read information about the device (enumeration) All devices must support Control Transfers at Endpoint 0 Control transfers require both an IN and OUT Endpoint Talks to the device through Address 0 while enumeration Maximum Packet Size: 8,16,32,64 18
Control Transfer (2) SETUP STAGE DATA STAGE STATUS STAGE 19
USB Communication Blocks (1) Transfer Types • Control Transfer • Interrupt • Bulk • Isochronous Transaction Transaction Transaction Types • OUT • IN • SOF (Start of Frame) • SETUP Token Packet Data Packet Handshake Packet 20
USB Communication Blocks (2) 21
LPC23xx 22
LPC2300 Family 23
LPC2378 (1) 24
LPC2378 (2) 25
Dual AHB Concurrent operations become possible: Ethernet packet reception and transfer to SRAM – CPU Instruction Fetch – USB packet reception and transfer to SRAM – GP DMA – Dedicating AHB Bus to Ethernet is required to guarantee 100 Mbits/sec Ethernet throughput without contention with other peripherals 26
USB 2.0 Fully Compliant with USB 2.0 Spec Supports Control, Bulk, Interrupt and Isochronous endpoints Scalable realization of Endpoints at Run time Double buffering supported for Bulk and Isochronous Endpoints Supports DMA transfer on all non-control endpoints 27
Available USB Device Stacks for LPC2300/2400/214x (list does not claim to be complete…) Keil RL-USB: – http://www.keil.com/arm/rl-arm/rl-usb.asp Micrium µC/USB Device – http://www.micrium.com/products/usb/usb-device/overview.html Micro Digital smxUSBD – http://www.smxrtos.com/rtos/usb/smxusbd.htm HCC Embedded USB (EUSB) Device Stack – http://www.hcc-embedded.com/site.php?mid=120 CMX-USB – http://www.cmx.com/cmx_usb.pdf Express Logic USBX – http://www.rtos.com/page/product.php?id=6 28
Available USB Host Stacks for LPC2400/ LPC3180 (list does not claim to be complete…) Micrium µC/USB Host – http://www.micrium.com/products/usb/usb-host/usb-host.html Micro Digital smxUSBH – http://www.smxrtos.com/rtos/usb/smxusbh.htm HCC Embedded USB (EUSB) HostLite Stack – http://www.hcc-embedded.com/site.php?mid=180 Express Logic USBX – http://www.rtos.com/ OnChip Technology – http://www.onchiptech.com/wb/pages/products/otusb.php 29
30
Recommend
More recommend