USB Device

Transcription

USB Device
17054 USB1
Introduction to
Microchip USB Solutions
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
1
Objectives
When you finish this class you will
be able to:



Describe the basics of USB, and how
apply them in an embedded application
Identify Microchip’s USB MCUs,
development boards, and USB software
frameworks relevant to your project
Chose the right USB MASTERs classes
you need to attend
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
2
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
3
Universal Serial Bus
Extend the functionality of
your computer!
Data Analysis,
Data Logging,
Firmware Updates,
Diagnostics,
Embedded Applications!
•
•
•
•
•
Auto detection & configuration (Plug & Play)
Easy expansion using hubs
Bus power
Data CRC protected, bad packets resent
Four speeds:
Low- 1.5, Full- 12, High- 480, Super- 5000 Mb/s
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Serial
Parallel
PS/2
Slide
4
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
5
USB Basics
USB is a “Single Master + Multiple Slaves” polled bus
USB Host Controller (Master)
and Root Hub
Mouse
Start Of Frame
Printer
Mouse Packets
Frame
© 2013 Microchip Technology Incorporated. All Rights Reserved.
Speakers Packets
Frame
17054 USB1
Speakers
Printer Packets
Frame
Slide
6
USB Host




Manages and controls the bus
Initiates all communications
Automatically detects all device insertions and
extractions
Enumerates all devices connected and matches
them with drivers
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
7
Typical MCU Requirements
for Host





Typically Host is a PC
USB 3.0 Host Controller, running at Full
Speed (12 Mbps) or High Speed (480
Mbps) or Super Speed (5 Gbps)
High throughput 32/64 bit CPU running a
Operating System like Windows®
USB Drivers identifying and enumerating
USB Devices
Automatic update of USB drivers
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
8
Host in Embedded Design

Alternative: Implement PC in an MCU



High Cost, Larger real estate
Overkill for Embedded Designs
Solution: Implement Embedded Host
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
9
Embedded Host



Embedded Host connects to a fixed number of USB
Peripheral Devices – USB Drivers fixed in firmware
Advantage: Smaller, less complex embedded firmware
Example: Remote Temperature Data Logger



Download data to USB Flash Drive
Not connected directly to PC Host but …
You can exchange data with PC Host using the Flash Drive
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
10
Typical Requirements for
Embedded Host





Peripherals to service real world I/O:
 A/D converters, Comparators, etc.
 Serial Interfaces like SPI, I2C™, UART
 PWMs, Timers and I/O lines
Full Speed (12 Mbps) USB 2.0 Transceiver with
data input/output buffers
High throughput 16/32-bit MCU
Host Firmware Drivers to identify and
enumerate USB Peripheral Devices
Microchip’s 16 and 32 bit USB PIC® MCUs are
designed for Embedded Host applications
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
11
USB 2.0 vs USB 3.0


Microchip USB MCUs support USB
2.0 full-speed or low-speed
USB 3.0 devices are supported at
full-speed (12Mbps)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
12
USB Peripheral Device




Responds to Host, cannot initiate transactions
Requires drivers to be recognized by the Host
Hardware/Firmware to respond to Host
Microchip’s PIC® MCUs are used in USB
Peripheral Devices
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
13
Typical MCU Requirements
for Peripheral Device

Peripherals to service real world I/O:







A/D converters, Comparators, etc.
Serial Interfaces like SPI, I2C™, UART
PWMs, Timers and I/O lines
Full Speed (12 Mbps) USB 2.0 Transceiver with
data input/output buffers
Throughput to service Full speed USB requests
USB Device and peripheral interface Firmware
All USB PIC® MCUs are designed for USB
Peripheral Device applications
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
14
USB On-The-Go (OTG)

USB On-The-Go (OTG) allows Application to operate as
Host or Device:



PDA (Device) connected to PC (Host)
PDA (Host) connected to Thumb drive (Device)
PDA connected to PDA, host and device roles can switch (OTG
mode)
PC Host
PDA OTG Device
© 2013 Microchip Technology Incorporated. All Rights Reserved.
PDA OTG Host
PDA OTG Host
Thumb Drive
PDA OTG Device
17054 USB1
Slide
15
Typical Requirements for OTG
Devices




Peripherals to service real world I/O:
 A/D converters, Comparators, etc.
 Serial Interfaces like SPI, I2C™, UART
 PWMs, Timers and I/O lines
Full Speed (12 Mbps) USB 2.0 OTG Transceiver
with data input/output buffers
High throughput 16/32-bit MCU
Host Software Drivers to identify and
enumerate USB Peripheral Devices


Device Drivers when connected to Host/OTG
Microchip’s 16 and 32-bit USB PIC® MCUs are
designed for USB OTG applications
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
16
Other USB Device Types

Hub


Repeats traffic (both directions), manages power
Compound Device


Contains a hub and 1 or more peripherals
Host treats hub and peripheral function separately (each
has its own address)


i.e. USB keyboard with 1-port hub
Composite Device


Has multiple interfaces active at the same time
Host loads a driver for each interface

i.e. video camera (both audio & video interfaces active)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
17
Dual Role Devices (DRDs)

Allows application to operate as Host or
Device:




2 connectors (Standard A & B or mini B or micro B)
Must have some type of mechanical block so that both
connectors are not accessible at any given point of time
No need to dynamically switch the role, connector used
decides which is the role
Example: Data Logger with field update via PC
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
18
DRD Example Circuit
PIC24F or PIC32MX
USB device
5v
PPTC
3.3v
VUSB
1μF
2KΩ
A/D
150μF
Embedded
Host
Receptacle
VBUS
DD+
GND
2KΩ
VBUS
Input
1μF
150KΩ
DD+
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Peripheral
Receptacle
VBUS
DD+
GND
Slide
19
Physical Interface


VBUS
VBUS
D+
D+
D-
D-
GND
GND
~ 5.0 V
~ 3.3 V
Half Duplex with NRZI Data Encoding
Bus Power to each device:



4.40 - 5.25 V
Guaranteed 100 mA
500 mA maximum through negotiation
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Must use external
power if more is
required
Slide
20
Standard Connectors
“A”
USB Host
Full or Embedded
“B”
USB
Device
“micro-B”
USB
Device
“mini-B”
USB
Device
μB
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
“micro-AB”
OTG
Device
μB
Slide
21
Standard Connectors
“micro-AB”
OTG
Host
“B”
USB
Device
“mini-B”
USB
Device
μA
“micro-B”
USB
Device
“micro-AB”
OTG
Host
μA
“micro-AB”
OTG
Device
μB
μB
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
22
Physical Bus Topology
USB Host Controller
& Root Hub
Host (Tier 1)
Tier 2
Keyboard
Speaker
Hub
Tier 3
Logic
Analyzer
Hub
Tier 4
Printer
Hub
Tier 5
Hub
Tier 6
Hub
Tier 7
Data Logger
Hub
Up to 126 peripherals...
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Hub: Max Chaining = 5
8-bit USB PIC® MCUs are
designed to be peripherals
16- and 32-bit USB PIC
MCUs and dsPIC® DSCs
can function as either
embedded hosts or
peripherals
Slide
23
Logical Bus Topology


Not a tiered-star!
Host software communicates to each
“logical” device as if it were directly
connected to the root hub
Host
Logical
Device
Logical
Device
Logical
Device
Logical
Device
Logical
Device
Logical
Device
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
24
USB Device Framework
Host System
Peripheral Device
Client
Client
Software
Client
Software
Software
Pipe Bundle
Interface
Interface-specific
USB System
Software
Default Pipe (EP0)
USB Logical
Device
Endpoint
zero
Transfers
Data per Endpoint
USB Bus Interface
Host
Controller
Transactions
SIE
USB Cable
Bus Interface
Layer
Bus Interface
Layer
USB Device
Layer
USB Device
Layer
Buffers
Function
Function
Function
Function Layer
Function Layer
- Software View of Hardware -
USB Bus
Interface
SIE
Physical Communication Path
Logical Communication Path (“Pipe”)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
25
Endpoints: Source/Destination of USB
Data in a Peripheral
Data Bucket
USB
USB framed data
USB framed data

MCU
RAM
Endpoint 1 OUT
RAM
Endpoint 1 IN
LED
“Caps-Lock”
Maximum number of endpoints per device specified by USB
specification:




PIC®
16 OUT endpoints + 16 IN endpoints = 32 endpoints
PIC18F87J50, PIC18F4550, PIC24F, PIC32MX supports up to 32
endpoints
PIC18F14K50 supports up to 16 endpoints
EP0 = Default Communication Pipe
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
26
The “Logical” Device
Device
(Manufacturer: Microchip Technology)
(Product: Mouse in a Circle Demo)
Configuration
Interface
Analog/Digital I/O
IN (Endpoint x)
USB Device-Specific Pipe(s)
(Human Interface Device)
OUT (Endpoint x)
IN (Endpoint 0)
USB System Software
(default control pipes)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
OUT (Endpoint 0)
17054 USB1
HID TX/RX Functions
(MCHPFSUSB FW)
These settings are
represented by a Device
Descriptor Table, stored
in firmware. More on
this later…
Slide
27
USB Transaction
USB Transaction
Token Packet
SETUP and OUT token types
inform the target device that
the host wants to send data.
Specifies:
• Target device address
• Endpoint number
• Direction of the data transfer
IN token type informs the target
device that the host wants to
fetch data.
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
28
IN Transaction ACK
USB Transaction
IN Token Packet
Data Packet
Handshake Packet
Acknowledge - ACK
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
29
IN Transaction NAK
USB Transaction
IN Token Packet
Handshake Packet
Not Acknowledge - NAK
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
30
OUT Transaction ACK
USB Transaction
OUT Token Packet
Data Packet
Handshake Packet
Acknowledge - ACK
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
31
OUT Transaction NAK
USB Transaction
OUT Token Packet
Data Packet
Handshake Packet
Not Acknowledge - NAK
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
32
Demo
- Capturing a Transaction -


To read the potentiometer value, the PIC24F USB embedded
host continually sends command “0x37”
The PIC18F USB device Returns Command Code + 10-bit
Potentiometer ADC value: <0x37><ADRESL><ADRESH>
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
33
Demo
- Capturing a Transaction -
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
34
Transfer: A Group of Related
Transactions
MPUSBWrite(EP7, Pointer, Size = 129, Timeout)
Transfer
Key:
Transaction 1
OUT Token Packet
64 Byte Payload
Data Packet
Transaction 2
ACK Handshake Packet
64 Byte Payload
Transaction 3
1 Byte Payload
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
35
Data Transfer Types
Transfer/
Endpoint
Type
Polling
Interval
% Reserved
BW/Frame for
all transfers of
this type
Max. # Data
Bytes/Frame/Endpoint
(Max# transactions per
frame @ Max Ep Size)*
Data
Integrity
Interrupt
Fixed, Periodic
90
64 (1 x 64)
Yes
Isochronous
Fixed, Periodic
90
1023 (1 x 1023)
No
Bulk
Variable, Uses
Free Bandwidth
0
1216 (19 x 64)
Yes
Control
Variable
10
832 (13 x 64)
Yes
*Assumes transfers use maximum packet sizes allowed per Ep type
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
36
Interrupt Transfer Example
MPUSBWrite(EP7, Pointer, Size = 129, Timeout)
Traffic to other
Endpoints or Idle
64
Transactions
1
64
Frame
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
37
Bulk Transfer Example
MPUSBWrite(EP7, Pointer, Size = 129, Timeout)
Transactions only
occur if no higher
priority traffic
Int.
Isoc.
Int.
64
64
Int.
1
Frame
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
38
Theoretical Maximum Transfer
Rate Per Endpoint
1400
1216
1200
1023
1000
KByte/s
832
800
600
Low
Full
400
200
24
0
0.8
64
Control Interrupt
Bulk
Iso
Transfer Type
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
39
Quiz!
Mouse
Printer
Speaker
Control
+
Interrupt
Control
+
Bulk
Control
+
Isochronous
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
40
USB Device Classes
Floppy
Drive
Data Glove
Ethernet
Adapter
Mouse
External
Hard Drive
PICkit™ 3
Starter Kit
Joystick
Mass Storage Device
Class (MSD)
Modem
Communication Device
Class (CDC)
Keyboard
MPLAB®
REAL ICE™
in-circuit emulator
Custom Class
(Vendor Class)
Human Interface Device Class
(HID)
Many more classes….
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
41
The Enumeration Process
Power
(self/bus)
POWERED
Bus
reset
ATTACHED
DEFAULT
Cable
Connected
Get Device
Descriptor
SUSPENDED
DETACHED
ADDRESS
Get
Descriptors
CONFIGURED
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
42
Descriptors
Device
String 0
String 1
To other Configurations if any
String N
Configuration 1
To other
Interfaces if any
Interface 0
Endpoint

Endpoint
Interface 1
Endpoint
Endpoint
Descriptors are typically stored in non-volatile/Flash memory
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
43
Descriptors - Example
Manu. String
Device
USB 2.0, VID = 0x04D8,
PID = 0x0007, Num. Configurations,
Strings?
Configuration 1
Configuration #1: Bus-Powered,
Remote Wakeup, 500mA, Num.
Interfaces
Interface 0
Interface #0: HID Class, Num.
Endpoints
Endpoint
Endpoint 1 IN, Interrupt Transfer
Type, 64-byte buffer, Poll every 3 ms
Microchip
Prod. String
PICDEMTM USB
Other String
Go USB!
Unicode
Characters
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
44
Demo
- Viewing Descriptor Information -
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
45
VID & PID


Vendor ID (VID):
16-bit number

Required to market your product

http://www.usb.org/developers/vendor

USD $5,000

Technical & Legal trouble if not using an
approved VID
Product ID (PID):

16-bit number
Microchip’s Sub-licensing Program
Every USB Device product line is required to have
a unique combination of VID and PID
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
46
USB Compliance




Compliance Testing

Must pass to use USB logo

Test fee: USD ~$1,500
Tests device for conformance to USB
Framework and Class standard control
requests
 USB Protocol Analyzer
 “USBCV” USB Command Verifier
 www.usb.org/developers/tools
Electrical Signal Quality
Power Management
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
47
Compliance Testing

For USB Compliance Testing:

Download appropriate Compliance Checklist:
 Peripheral
Checklist
 OTG Compliance & Embedded Host Checklist


Use certified USB receptacle and cable for testing
Know the TID (Test ID) of your components
 Find

USB PIC® MCUs TID number on www.microchip.com/usb
For USB Compliance certification:

Independent Test Labs (see www.usb.org for a list)
 You
need to provide them a compiled Checklist with your device
It’s a good idea to take a look at the
checklist before starting your design!
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
48
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
49
USB 2.0 Protocol Converters

USB 2.0 Compliant (certified) – Full Speed




USB Host can communicate with legacy RS232
(MCP2200) or SPI (MCP2210) peripherals
Configurable; up to 9 GPIO pins
Small packaging
“Plug and play”
Development kits
(ADM00421; $29.99)
SPI
MCP2200
or
MCP2210
(MCP2200EV-VCP; $23.99)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
50
SMSC USB Products



SMSC is the leader in USB devices
All SMSC USB devices connect upstream to the SoC
host. (note: SMSC does not make USB hosts chips)
SMSC provides expansion and additional functionality
not included in the SoC (or sometimes not practical to
include in the SoC) we also offer combo versions of
most of these devices.
USB 2.0 HUBS
USB 2.0 Flash
Media Reader
USB 2.0 PHY
USB 3.0 HUB
USB 2.0 to 10/100
BRIDGE
USB 2.0 Smart
Card reader
USB Switch
USB 2.0 / USB 3.0
to Graphic
USB 2.0 to 10/100/ USB 2.0 FMR with
USB 2.0 Charging
1000 BRIDGE
ENCRYPTION
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
HSIC USB 2.0
Slide
51
Scalable USB
PIC® MCU Portfolio
Performance
100+ USB PIC MCUs
The industry’s strongest
scalable product, family,
and software migration path
PIC32
High Performance
Up to 200 MHz, 1.57 DMIPS/MHz
28- to 144-Pin Packages
Up to 2MB Flash
Up to 512KB RAM
USB 2.0 Device, Embedded Host, OTG
Up to 480Mb/s (PIC32MZ)
PIC24F/PIC24E/dsPIC33E
Low Power, GPU, DSP Engine
Up to 70 MIPS
28- to 144-Pin Packages
Up to 512 KB Flash
Up to 96KB RAM
USB 2.0 Device, Embedded Host, OTG
PIC16F1/PIC18F
32-bit
Small, Low Power, Low Cost
Up to 16 MIPS
14- to 80-Pin Packages
Up to 128KB Flash
Up to 4KB RAM
USB 2.0 Device Support
16-bit
8-bit
Migration
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
52
Microchip USB Framework
- www.microchip.com/MLA  USB Framework



PIC16F, PIC18F, PIC24F/E, dsPIC33E (and PIC32)
XC8/XC16(/XC32) Compatible
MPLAB® X IDE Project Centric
 Device



Stacks
Audio, CCID, CDC, HID, MSD, PHDC, Custom
Polling or Interrupt driven
Embedded Host Stack


16-bit (and 32-bit) USB MCUs
Client drivers for Basic Android Accessory, Audio, CDC,
Charger, Custom, HID, MIDI, MSD, Printer
 On-The-Go

(OTG) Support
16-bit (and 32-bit) USB MCUs
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
53
Device Class Demos Available
Joystick
MIDI
SDC Data
Logger
Basic
UPS
Microphone
Speaker
Digitizer
Blood
Pressure
Custom
Thermometer
More demos in
future
releases…
Communication Device
Class (CDC)
Mass Storage Device
Class (MSD)
Audio
Class
Keyboard
Human Interface
Device Class (HID)
SD Card
Reader
RS-232
Mouse
Weighing
Scale
Pulse
Oximeter
Smart Card
Reader
Smart Card
Class
Internal
Flash
CDC+MSD
WinUSB+MSD
HID+MSD
Composite
Demos
WinUSB
Glucose
Meter
high bandwidth
MCHP
WinUSB
Personal Healthcare
Device Class
LibUSB
Custom Class
(Vendor Class)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
54
Embedded Host Client Driver
Demos Available
Mouse
MIDI
Keyboard
Audio
Class
Communication Device
Class (CDC)
Human Interface
Device Class (HID)
Print
Screen
Simple Full
Sheet
Simple POS
Printer Class
Simple
Charger
MCHP
CDC+MSD
HID+MSD
Simple
Demo
Mass Storage Device
Class (MSD)
Dual Role Device
MSD Host + HID Device
Composite
Demos
OTG
MCHP Custom
Battery Charging
Class
Custom Class
(Vendor Class)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
Thumb
Drive Data
Logger
RS-232
More demos in future releases…
17054 USB1
Slide
55
32Bit Middleware and
Software Ecosystem

Software Platform Key Features and Benefits:






Modular peripheral drivers and Middleware layers
Dynamic Multi-client driver support
Designed to be RTOS friendly
Designed for Interoperability and 32Bit MCU scalability
Integrated, Verified & Supported 3rd Party Partner
solutions
Interested in learning more? Attend “17033
MPLAB® Harmony” for the Next Generation
Middleware/Ecosystem or stop by the “Ask-theExperts” booth for more info
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
56
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
57
Considerations When Using
Standard Classes

The Logical USB Device is
pre-defined


The Device data communication
protocol is defined


Max. bandwidth is fixed
For MSD Class the PIC® MCU looks like
a “Removable Disk” and OS wants to
read and write files to it (a File System
may be needed to allow that)
Main Benefit: Cross-platform use

Custom OS driver is not required!
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
58
CDC – RS-232 Emulation
PIC® Microcontroller
PC Computer
CDC
Standard Windows Drivers
USB Cable
Hyper Terminal
INF File Required
(Supplied in MLA)
Design Considerations:
• ~80 KB/s max
• Bulk Transfers
• PC applications can access the device as though it
is connected to a serial COM port
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
59
Human Interface Device (HID)
PIC® Microcontroller
PC Computer
HID\Mouse
Standard Windows Drivers
HID App
HID Bootloader
USB Cable
Design Considerations:
• 64 KB/s max
• Interrupt Transfer Type
• Standard Windows driver
• Custom PC application can access HID data
through HID Class DLL (Supplied in MLA)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
60
Custom Class Driver
PIC® Microcontroller
PC Computer
Generic Driver Demo
winusb.sys
winusb.dll
Bootloader
Simple
WinUSB
Demo
Other C++
Binary
Only
Examples
USB Cable
INF File Required
(Supplied in MLA)
Design Considerations:
• ~1,088 KB/s max
• Very flexible (Control, Bulk, Interrupt transfers are
possible)
• PC programming is required
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
61
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
62
USB Classes

USB Device
 17055 USB2
USB Human Interface Device (HID) Class

17056 USB3
Implementing Custom USB Devices:
Firmware and PC Software

17057 USB4
USB Communication Device Class (CDC)
– Serial Port Emulation
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
63
USB Classes

USB Device
 17058 USB5
Universal USB Charging: It's not just Wall
Warts and Laptops

17059 USB6
Introduction to Microchip USB Hubs
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
64
USB Classes

USB Embedded Host
 17031 FAT
Using the FAT File System Library to
Manipulate Files on a USB Thumb Drive

PCB Design
 17108 PCB2
Designing for Success with USB
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
65
Microchip Technical Training





Worldwide Training Centers
and live online classes
In-depth Technical Training
with Hands-on
Ethernet, Motor control,
Graphics, USB, etc.
Local Language Support
Live Onsite training available
www.microchip.com/training



USB classes
COM3101 – Introduction to FullSpeed USB
COM3201 – Designing a Custom
USB Peripheral
Application
COM3202 – Designing a USB
Embedded Host
Application
© 2013 Microchip Technology Incorporated. All Rights Reserved.
Wrap
Up
17054
USB1
Slide
66
Agenda





USB Fundamentals
Microchip USB solutions
Design considerations
How to get started
Summary
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
67
Summary

USB Fundamental



Microchip USB solutions





USB 2.0 Protocol converters
USB Hubs, Bridges, FMRs, PHYs, Switches, Graphics, etc.
(SMSC)
USB PIC® MCUs and dsPIC® DCSs
Free USB software & demo codes
Design considerations


Host is master
Up to 126 devices sharing bandwidth
USB Classes Pros & Cons
How to get started


USB classes at MASTERs 2013
Microchip Technical Training Live
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
68
Additional Resources

Microchip Design Center
www.microchip.com/USB
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
69
Microchip USB Framework
- Supported Platforms 









Low Pin Count USB Development Kit (PIC18F14K50 Family)
PICDEM™ Full Speed USB (PIC18F45K50 family)
MPLAB® Starter Kit for PIC18F MCU (PIC18F46J50 family)
PIC18FxxJ50 FS USB Demo Board (+ PIC18 Explorer Board)
MPLAB Starter Kit for PIC24F (PIC24FJ256GB106)
PIC24FJ256DA210 Development Kit
PIC24F USB PIMs (+ Explorer 16 + USB PICtail™ Plus)
PIC32 USB PIMs (+ Explorer 16 + USB PICtail Plus)
PIC32 USB Starter Board (PIC32MX460F512L family)
PIC32 USB Starter Board II (PIC32MX795F512L family)
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
70
USB Evaluation Boards
$69.48
USB3740 High-Speed Switch Evaluation Board
Part Number: EVB-USB3740
The USB3740 is a high-performance USB 2.0 switch providing
excellent flexibility with very low current consumption in an
extremely small package.
$50.00
USB2514B Hi-Speed USB 2.0 Multi TT 4 Port Hub w/
Battery Charging Support
Part Number: EVB-USB2514BC
Low-Power, full-featured, OEM configurable Hi-Speed USB 2.0
compliant hub w/ 4 downstream ports; each of which supports
battery charging.
$84.50
USB2640 USB 2.0 2 Port Hub, with Ultra Fast Flash
Media Controller Eval Board
Part Number: EVB-USB2640
The board features an Ultra Fast USB 2.0 Hub, Flash Media Controller,
and Protocol Bridge Combo. It demonstrates a standalone
application for developers of Flash Media Card Reader/Writers,
printers, desktop and mobile PCs, consumer A/V, and flat panel
displays, …
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
71
Low Pin Count
USB Development Kit

Contains everything you need to get started quickly



Includes self-directed class and lab material
Quickly implement common USB functions:




RS-232 to Serial
Keyboard/Mouse, etc…
Priced from $39.99
Part Numbers



Use with 20-pin PIC18F USB microcontrollers PIC18F13K50,
PIC18F14K50 and new PIC16F145x USB microcontrollers
DM164127
DV164139 (w/PICkit™ 3 programmer)
Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
72
PICDEM™ Full Speed
USB Demo Kit

Contains everything you need to get started quickly

Use with any of the PIC18F45K50 family microcontrollers

Includes self-directed class and lab material

The Demo Kit provides all of the hardware and software
needed to demonstrate and develop a complete USB
communication solution

Priced from $59.99

Part Numbers


DM163025-1
Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
73
PIC18 Starter Kit





Functions as a USB mouse, joystick or mass storage
device all using the on-board capacitive touch sense
pads
Includes a MicroSD™ memory card, potentiometer,
acceleration sensor, and OLED display
On-board debugger/programming
Completely USB-powered
Demonstrates PIC18 Family



Priced from $59.98
Part Numbers


USB communication
DM180021
Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
74
PIC18FXXJ50 Full-Speed
USB Plug-In Module (PIM)





Contains everything you need to get started quickly
Can be plugged into PICDEM™ HPC Explorer
Board or PICDEM PIC18 Explorer Board
Can be operated as a stand-alone board
Priced from $40.00
Part Numbers






MA180021 MA180024 MA180029 MA180033 DM183032 -
PIC18F87J50 FS USB PIM
PIC18F46J50 FS USB PIM
PIC18F47J53 FS USB PIM
PIC18F87J94 FS USB PIM
PICDEM PIC18 EXPLORER BOARD
Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
75
PIC24FJ256DA210
Development Kit


The PIC24FJ256DA210 Development Kit is a low cost
and efficient development kit to evaluate the features
and performance of the PIC24FJ256DA210 with
integrated graphics, mTouch™ sensing solution and
USB.
Part Number: DV164039
Contains: PIC24FJ256DA210 Development Board (DM240312)
3.2” Truly 240x320 TFT Display Board (AC164127-4)
Graphics Display Prototype Boards - 3x (AC164139)
MPLAB® ICD 3 Emulator and Debugger with USB Cable DV164035)
9V Power Supply (AC162039)



PICtail™ Plus Daughter
Board expansion slot
Priced from $399.99
Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
76
16-/32-bit USB Starter Kits

PIC24F Starter Kit




PIC32 USB Starter Kit II




Part #: DM320003-2
PIC32MX795F512L
Priced from $55.00
Debugger
Port
Thumb Drive
Connection
(Host)
PIC32 USB Starter Kit III




Part #: DM240011
PIC24FJ256GB110
Priced from $59.98
On-The-Go Port
(Dual-Role)
Part #: DM320003-3
PIC32MX450F256L
Priced from $59.99
All Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
77
16-/32-bit USB Development
Boards

Explorer 16 + USB PIMs + USB PICtail™ Plus
Daughter Board





Part #: DM240001
Part #: MA240014, MA240019, MA240021, MA320002,
MA320003
Part #: AC164131
Priced from $214.99
All Available Now
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
78
Thank You!
Please complete the Class Evaluation Form
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
79
LEGAL NOTICE
SOFTWARE:
You may use Microchip software exclusively with Microchip products. Further, use of Microchip software is subject to the copyright notices, disclaimers, and any license
terms accompanying such software, whether set forth at the install of each program or posted in a header or text file.
Notwithstanding the above, certain components of software offered by Microchip and 3 rd parties may be covered by “open source” software licenses – which include
licenses that require that the distributor make the software available in source code format. To the extent required by such open source software licenses, the terms of
such license will govern.
NOTICE & DISCLAIMER:
These materials and accompanying information (including, for example, any software, and references to 3 rd party companies and 3rd party websites) are for informational
purposes only and provided “AS IS.” Microchip assumes no responsibility for statements made by 3 rd party companies, or materials or information that such 3 rd parties
may provide.
MICROCHIP DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING ANY IMPLIED WARRANTIES OF
NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY DIRECT OR
INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL, OR CONSEQUENTIAL LOSS, DAMAGE, COST, OR EXPENSE OF ANY KIND RELATED TO THESE MATERIALS OR
ACCOMPANYING INFORMATION PROVIDED TO YOU BY MICROCHIP OR OTHER THIRD PARTIES, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
POSSIBLITY OF SUCH DAMAGES OR THE DAMAGES ARE FORESEEABLE.
TRADEMARKS:
The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, K EELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC, SST, SST Logo,
SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MTP, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
Analog-for-the-Digital Age, Application Maestro, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient
Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O, Total Endurance, TSHARC,
UniWinDriver, WiperLock, ZENA and Z-Scale are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
GestIC and ULPP are registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
© 2013 Microchip Technology Incorporated. All Rights Reserved.
17054 USB1
Slide
80