Usb

65
V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 1 USB for Embedded Applications Microchip Technology

description

USB

Transcript of Usb

Page 1: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 1

USBfor Embedded ApplicationsMicrochip Technology

Page 2: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 2

Objective

Understand the basics of USB, and how it can be used in an embedded applicationBe familiar with Microchip’s MCUs, development boards, and USB software framework.Be able to create a simple PC application that exchanges data with a USB device

Page 3: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 3

Part 1.Introduction to Full-Speed USB

Page 4: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 4

ObjectivesUnderstand how USB can be useful in an embedded systemLearn about fundamental USB architecture, protocol and programmer’s modelBe aware of the factors important in designing a USB applicationIdentify key USB capabilities in PIC18 USB MCUs

Page 5: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 5

AgendaBrief history of USB & USB-IFUSB Fundamentals - The serious & important stuff−

Basics/Speeds−

Architecture/Programmer’s Model−

Physical Connection−

USB Transactions−

USB Transfers−

Device Classes−

Enumeration−

Descriptors−

Power Planning−

VID/PID & USB CompliancePIC18F USB MicrocontrollersMicrochip Demo/Development Solutions

Page 6: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 6

A little history...USB was co-developed by a group of companies….−

Compaq

Intel−

Microsoft

NEC−

…who wanted to make it much easier to add/remove peripheral devices from PCs

1998 - USB 1.12000 - USB 2.0

Page 7: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 7

Universal Serial BusExtend 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.• Three speeds:

Low-

1.5, Full-

12, High-

480 Megabits / second

SerialParallel

PS/2

Page 8: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 8

USB BasicsUSB is a “Single Master + Multiple Slaves” polled bus

Mouse SpeakerPrinter

USB Host Controller (Master) and Root Hub

SOF

1 ms 1 ms 1 ms

SOF SOFIntEP1

IsoEP1

BulkEP2

IntEP1

IntEP1

BulkEP2

Start Of Frame

IsoEP1

IsoEP1

IsoEP1

IsoEP1

Page 9: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 9

Buses & Speeds Comparison

1394-Fire Wire

1 Gb1 Gb480 Mb/s480 Mb/s100 Mb/s100 Mb/s12 Mb/s12 Mb/s1.5 Mb/s1.5 Mb/s1 Mb/s1 Mb/s500 Kb/s500 Kb/s

Ethernet

Serial Port

LS-USB1.5 Mb/s

FS-USB12 Mb/s

HS-USB480 Mb/s

USB 1.1

USB 2.0

Parallel Port

WiFi (b/g)

CAN

Does not have to support High-Speed

to be USB 2.0 Compliant

Page 10: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 10

Biggest MythMYTH: A Low-Speed USB peripheral can transfer application data up to 187.5 KB/s (1.5 Mbps)

FACT: Impossible, because of a USB specification restriction:−

8 byte data transfer every 10 ms

= 800 Bytes/second only

Page 11: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 11

Next Biggest Myth

MYTH: A Full-Speed USB peripheral can transfer data up to 1.5 MB/s (12 Mb/s)

FACT: Impossible, 1.5 MB/s is the total bus bandwidth−

Must be shared among peripherals

Protocol overhead−

Protocol restrictions

Realistic raw data throughput to a single peripheral is ~1.0 MB/s

Only 64KB/s in some cases

Page 12: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 12

Physical Bus TopologyUSB Host

Controller& Root Hub

HubHub

HubHub

HubHub

HubHub

HubHub

HubHub

Speaker

Data Logger

LogicAnalyzer

Up to 126 peripherals...

Keyboard

Hub: Max Chaining = 5

PIC18 USB devices are designed to be

peripherals!

Host (Tier 1)

Tier 2

Tier 3

Tier 4

Tier 5

Tier 6

Tier 7

Page 13: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 13

Logical Bus TopologyNot a tiered-star!Host software communicates to each “logical” device as if it were directly connected to the root hub

HostLogical Device

Logical Device

Logical Device

Logical Device Logical

Device

Logical Device

Page 14: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 14

Accessing PC PeripheralsOld WayPC Peripherals:−

Memory-mapped into the x86 I/O address space

Assigned a specific IRQ line

Assigned a specific DMA channel

Accessed directly (ISA, PCI, PCMCIA)

USB WayPC Peripherals:−

Mapped into a virtual 127 device address space

Does not use any PC I/O, IRQ or DMA resources

Accessed indirectlyusing the programming interface provided by the device driver

Page 15: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 15

Host System

USB Adapter/Controller

User Code

Non USB Format

USB Device Driver

Non USB Format

USB System Software

USB Data Frames

Bus

Inte

rfac

eLa

yer

Peripheral Device

Bus Interface

Device Specific Comm

Logical Device

USB Data Frames

Bus Interface

Layer

DefaultPipe (Ep0)

Driver Specific

Pipes (Ep1..)

Physical Communication PathLogical Communication Path (“Pipe”)

USB Device Framework -

Software View of Hardware -

Cable

Physical Device

US

B D

evic

e La

yer

Fun

ctio

n La

yer

US

B D

evice Layer

Function Layer

Page 16: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 16

The “Logical”

USB DeviceDevice(ex. USB Mouse)

Configuration(Active)

Interface(Mouse)

Endpoint 0(Control -

OUT)USB System Software

USB Device Driver (HID) HID TX/RX Functions

Real-World

Endpoint 0(Control -

IN)

Endpoint 1(Interrupt -

IN)

Endpoint 1(Interrupt -

OUT)

Page 17: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 17

Physical Interface

Half Duplex with NRZI Data EncodingBus Power to each device:−

4.40 - 5.25 V−

Guaranteed 100 mA−

500 mA maximum through negotiation

~ 5.0 V

~ 3.3 V

Must use external power if more is

required

VBUS

D+

D-

GND

VBUS

D+

D-

GND

~ 5.0 V

~ 3.3 V

Page 18: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 18

“mini-B”FS, HS

Peripheral

“B”FS, HS

Peripheral

USB Connectors“A”

Plug

USB Host

LS, FS, HSPeripheral

Hardwiredor

CustomDetachable

“micro-B”

Peripheral

Page 19: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 19

AgendaBrief history of USB & USB-IFUSB Fundamentals - The serious & important stuff−

Basics/Speeds−

Architecture/Programmer’s Model−

Physical Connection−

USB Transactions−

USB Transfers−

Device Classes−

Enumeration−

Descriptors−

Power Planning−

VID/PID & USB CompliancePIC18F USB MicrocontrollersMicrochip Demo/Development Solutions

Page 20: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 20

How do the host and the device communicate?

Transactions…

Page 21: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 21

An Endpoint is a Buffer

RAMEndpoint 1 OUT

RAMEndpoint 1 IN

Data Bucket

LED

Keystroke(s)

Maximum number of endpoints per device specified by USB specification:−

16 OUT endpoints + 16 IN endpoints = 32 endpoints−

PIC18F87J50, PIC18F4550 supports up to 32 endpoints

EP0 = Default Communication Pipe

IN Transaction

OUT Transaction

Page 22: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 22

USB Transaction

Token Packet

USB Transaction

Specifies:• Target device address• Endpoint number• Direction of the data transfer

SETUP

and OUT

token types inform the target device that the host wants to send data.

IN

token type informs the target device that the host wants to fetch data.

Page 23: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 23

USB Transaction -

IN

IN

Token Packet

USB Transaction

Data Packet

Page 24: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 24

USB Transaction -

IN

IN

Token Packet

USB Transaction

Data Packet

Handshake Packet

Acknowledge -

ACK

Page 25: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 25

IN Transaction ACK

IN

Token Packet(to EP1 IN)

USB Transaction

Data Packet

Handshake Packet

RAMEndpoint 1 OUT

RAMEndpoint 1 IN

SFR EP1 OUT BD(UOWN, Length,

Pointer)

SFR EP1 IN BD(UOWN, Length,

Pointer)

Update B

D

Serial

Interface

Engine

USB Traffic USB PIC®

MCU

Keystrokes

If UOWN = 1

Sets UOWN = 0

SIE Sends Data

Page 26: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 26

IN Transaction NAK

IN

Token Packet(to EP1 IN)

USB Transaction

RAMEndpoint 1 OUT

RAMEndpoint 1 IN

SFR EP1 OUT BD(UOWN, Length,

Pointer)

SFR EP1 IN BD(UOWN, Length,

Pointer)

Serial

Interface

Engine

USB Traffic USB PIC®

MCU

If UOWN = 0

SIE Sends NAKHandshake

Packet

Page 27: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 27

OUT/SETUP Transaction ACK

OUT/SETUPToken Packet (to EP1 OUT)

USB Transaction

RAMEndpoint 1 OUT

RAMEndpoint 1 IN

SFR EP1 OUT BD(UOWN, Length,

Pointer)

SFR EP1 IN BD(UOWN, Length,

Pointer)

Serial

Interface

Engine

USB Traffic USB PIC®

MCU

If UOWN = 1

Sets Length, UOWN = 0Data Packet

Handshake

PacketSIE Sends ACK

SIE Deposits Data

Page 28: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 28

OUT/SETUP Transaction NAK

OUT/SETUPToken Packet (to EP1 OUT)

USB Transaction

RAMEndpoint 1 OUT

RAMEndpoint 1 IN

SFR EP1 OUT BD(UOWN, Length,

Pointer)

SFR EP1 IN BD(UOWN, Length,

Pointer)

Serial

Interface

Engine

USB Traffic USB PIC®

MCU

If UOWN = 0

Data Packet

Handshake

PacketSIE Sends NAK

SIE Discards Data

Page 29: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 29

Key: Token Types

SETUP

OUT

IN

Page 30: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 30

How do the host and device communicate?

Transfers…

Page 31: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 31

Transfers Vs. TransactionsMPUSBWrite(EP7, Pointer, Size = 129, Timeout)

TransferTransaction 1

64 Byte Payload OUT Token Packet

Data Packet

ACK Handshake Packet

Key:

Transaction 264 Byte Payload

Transaction 31 Byte Payload

Transfer: Group of related transactions.

Page 32: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 32

Data Transfer TypesTransfer/

Endpoint TypePolling Interval

Priority Guarantees

Interrupt Fixed, Periodic

High 64 Bytes/Period, Data Integrity

Isochronous Fixed, Periodic

High 1023 Bytes/Period

Bulk Variable, Uses Free Bandwidth

Low Data Integrity

Control Variable Medium Some Bandwidth, Data Integrity

Page 33: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 33

Interrupt Transfer Example

1

MPUSBWrite(EP7, Pointer, Size = 129, Timeout)

64 64

Frame = 1ms

Traffic to other Endpoints or Idle Transactions

Page 34: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 34

Bulk Transfer Example

1

MPUSBWrite(EP7, Pointer, Size = 129, Timeout)

64 64

Frame = 1 ms

Transactions only occur if no higher

priority traffic

Int. Int.Isoc. Int.

Page 35: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 35

Theoretical Maximum Transfer Rate Per Endpoint

24

832

0.864

12161023

0200

400600

8001000

12001400

KByte/s

Control Interrupt Bulk Iso

Transfer Type

LowFull

Page 36: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 36

Transfer Types -

Examples

Mouse SpeakerPrinter

Control+

Interrupt

Control+

Bulk

Control+

Isochronous

Page 37: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 37

USB Device Classes

Joystick

MouseExternal

Hard Drive

ICD2

Modem

Floppy DriveData Glove

Keyboard

Ethernet Adapter

Human Interface Device Class (HID)

Mass Storage Device Class (MSD)

Communication Device Class (CDC)

Custom Class(Vendor Class)

Many more classes….

PICkit™

2 Starter Kit

Page 38: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 38

AgendaBrief history of USB & USB-IFUSB Fundamentals - The serious & important stuff−

Basics/Speeds−

Architecture/Programmer’s Model−

Physical Connection−

USB Transactions−

USB Transfers−

Device Classes−

Enumeration−

Descriptors−

Power Planning−

VID/PID & USB CompliancePIC18F USB MicrocontrollersMicrochip Demo/Development Solutions

Page 39: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 39

Enumeration and the magic behind

“Plug&Play” Auto-Detection &

Auto-Configuration

Page 40: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 40

PIC18 USB Microcontroller

Auto-Detection: Full-Speed

+5V

D+

D-

GND

Transceiver

USBConnector

Peripheral Device

VUSB

3.3 VFull Speed Identification

D+ line pull-up1.5 kΩ±5%

Page 41: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 41

PIC18 USB Microcontroller

Auto-Detection: Low-Speed

+5V

D+

D-

GND

Transceiver

USBConnector

Peripheral Device

VUSB

3.3 VLow Speed Identification

D-

line pull-up1.5 kΩ±5%

Page 42: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 42

PIC18 USB Microcontroller

On-chip Pull-up Resistors

+5V

D+

D-

GND

Transceiver

USBConnector

Peripheral Device

VUSB

3.3 V

On-chip pull-up resistors!

Controlled by UCFG<UPUEN> & UCFG<FSEN>

Page 43: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 43

Endpoint 0 and EnumerationSee Chapter 9 in USB 2.0 Spec for more info.

Other Endpoints

Endpoint 0 IN(Control Data)

Endpoint 0 OUT(Control Data)

Dual Port/Access RAMPIC18 USB Microcontroller

Descriptors

Control Transfers

Bus Reset Set Address Get Descriptors

Set Configuration

Device Ready

Page 44: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 46

Power PlanningMax USB suspend current is 0.5/2.5mADon’t:Power fromUSB Cable VDD

22µF

Page 45: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 47

Power PlanningMax USB suspend current is 0.5/2.5mADo:

≤10µF

Page 46: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 48

PIC®

MCU: Detecting a USB Attachment

If the device is self-powered, you MUST

use an I/O pin to detect a cable attachment.

Must not pull up D+ or D-

(and never source current on VBUS

) until host drives VBUS

high.

Page 47: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 49

Vendor ID (VID) 16-bit number−

Required to market your product

http://www.usb.org/developers/vendor/

USD $2,000

Technical & Legal trouble if not using your own VID

Product ID (PID) 16-bit number−

Microchip’s Sub-licensing Program

Every product line is required to have a unique combination of VID and PID

VID & PID

Page 48: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 50

USB ComplianceCompliance Testing

Must pass to use USB logo

USD ~$1,500

Ch9 and other USB Firmware−

USB Protocol Analyzer

“USBCV” www.usb.org/developers/tools/Electrical Signal QualityPower Management

Page 49: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 51

Compliance TestingFor USB Compliance: Independent Test LabsFor Device ‘Sanity Check’: USB “Plugfest”

For USB Compliance Testing:−

Must submit a compliance checklist−

www.usb.org/developers/compliance/peripheral_low/−

Download “Peripheral Checklist”

TID: Test ID−

Use certified USB receptacle and cable for testing−

Know the TID of your components−

All USB PIC® MCUs have a TID number. Get it at www.microchip.com/usb

Probably a good idea to take a look at the checklist even beforestarting your design!

Page 50: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 52

AgendaBrief history of USB & USB-IFUSB Fundamentals - The serious & important stuff−

Basics/Speeds−

Architecture/Programmer’s Model−

Physical Connection−

USB Transactions−

USB Transfers−

Device Classes−

Enumeration−

Descriptors−

Power Planning−

VID/PID & USB CompliancePIC18F USB MicrocontrollersMicrochip Demo/Development Solutions

Page 51: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 53

PIC18F4550

USB ModulePeripheral Device Board

SIE

Program MemoryUSB RAM

Control Registers

Data RAMTransceiver

3.3 V Regulator

Bus Pull-Up Resistors

D+/D-

Page 52: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 54

PIC18 USB MCU

D+/D-

Serial Interface Engine

SIE

Transceiver

SIE ...Serializes and deserializesUSB dataEncodes and decodes NRZI dataHandles bit stuffingChecks CRC to validate data packetDetects bus signaling events and notifies the CPU through interruptsHandles USB transactionsHandles handshaking protocol

Program MemoryUSB RAM

Control Registers

Data RAM

Page 53: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 55

AgendaBrief history of USB & USB-IFUSB Fundamentals - The serious & important stuff−

Basics/Speeds−

Architecture/Programmer’s Model−

Physical Connection−

USB Transactions−

USB Transfers−

Device Classes−

Enumeration−

Descriptors−

Power Planning−

VID/PID & USB CompliancePIC18F USB MicrocontrollersMicrochip Demo/Development Solutions

Page 54: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 56

PICDEM™

Full-Speed USBPIC18F4550, 20 MHz xtalUSB PortSerial PortPICtail™ Daughter Board Compatible

Power LED IndicatorsPotentiometerTemperature SensorPart Number -

DM163025

Page 55: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 57

PIC18F87J50 FS USB Plug-In Module (PIM)

PIC18F87J50, 12 MHz xtalUSB Port, mini-BLinear Regulator2 LEDs, 2 Pushbuttons

Stand alone operationOperation with: HPC Explorer Demo BoardICSP™ Technology: 6-pin header

Part Number –

AC164110

Part Number –

MA180021HPC Explorer –

DM183022

Page 56: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 58

PICtail™

Daughter Board for SD and MMC

Secure Digital Card Interface - using SPIAN1003: USB Mass Storage

Part Number –

AC164122

Page 57: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 59

Microchip USB Firmware Characteristics

C18 CompatibleMPLAB® IDE Project CentricPolling SchemeCooperative Multi-Tasking (No Blocking Routines)Program Memory Usage−

USB Enumeration (Chapter 9) - 3 KB

HID - 1 KB−

CDC (RS-232 Emulation) - 1 KB

USB Mass Storage - 4 KB

Page 58: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 60

SummaryBasics/Architecture−

Up to 126 devices sharing bandwidth

Host is masterHost/Device Communication−

Transactions

TransfersEnumeration/Chapter 9−

Descriptors

Microchip Offerings: MCUs, Demo Boards, Firmware, Custom Driver

Page 59: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 61

Windows® Programming

Page 60: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 62

Windows®

ProgrammingWith Visual C++ 2005 you have three basic ways of creating a interactive, graphicalapplication:−

Using the Windows API (Win32)

Most programming intensive−

Using the Microsoft Foundation Classes (MFC),

Encapsulate the Win32 API - easier−

Using Windows Forms (.NET Framework)

Least programming intensive

Visual C++ 2005 also allows you to create two types of console application (Win32 and CLR (.NET))−

We will be developing a “Win32 Console” C application

Why? Simplicity & Desire to focus on the DLL functions

Page 61: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 72

USB OTG

“On The Go”

Page 62: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 73

Types of USB

Low Speed1.2 Mbps

Full Speed12 Mbps

Mini-Host(Thumb Drives)

On the Go(Master & Slave)

NOW

NOW

IN DEVELOPMENT

IN DEVELOPMENT

Not Targets for Embedded

Market

Ideal for Embedded Market – Serial Port Replacement

High Speed480 Mbps

Device/Slave/Node

Hub

PIC24FJ256GB1

Other USB PIC microcontrollers

Supported Not Supported

Page 63: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 74

USB Device Classes

Joystick

Mouse

External Hard Drive

ICD2

Modem

Floppy Drive

Data Glove

Keyboard

Ethernet Adapter

Human Interface Device Class (HID)

Mass Storage Device Class (MSD)

Communication Device Class (CDC)

Custom Class(Vendor Class)

Many more USB classes….

PICkit™

2 Starter Kit

Thumb Drive

Beta Support

Page 64: Usb

© 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 75

Mass Storage Application Software Architecture for

Thumb Drive Demo

USB HostUSB Mass Storage Class (Host)

SCSI InterfaceFAT16

Application (“PIC-DOS”)

Page 65: Usb

V1.0 Oct 18, 2007 © 2007 Microchip Technology Incorporated. All Rights Reserved. 390_USB v1.0 Slide 76

Thank you !