Você está na página 1de 83

1542 USB3

Using USB Interface Bridges


to Enable Embedded System
Communication with USB Hosts
2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Class Objectives

When you finish this class you


will be able to:

Add USB connectivity to a UART


interface using the MCP2200
Add USB connectivity to a SPI
interface using the MCP2210

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

RS232 (UART w. voltage level


conversion) still very popular in
embedded systems

Simple, legacy communication


peripheral, still very popular in the
embedded world
RS232 ports almost disappeared
from PCs today

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Challenge bridge the gap


between:

RS232 (UART) still very popular in


the embedded world today
USB the most popular generalpurpose interface on the PCs

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Microchip offers USB-UART


interface solutions:

PIC MCUs with UART and USB

Standalone solution MCP2200

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Using PIC MCUs with UART and


USB
Features:

Complete integrated solution (includes


USB and UART peripherals); needs only
the bridge firmware

The target MCU can be used for more


than USB to UART conversion; the
remaining peripherals can be used for
other purposes

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Using PIC MCUs with UART and


USB
Pros:

The custom solution can offer more than


USB to UART conversion

The MCU used for USB-UART conversion


can perform the reminder of the system
functionalities

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Using PIC MCUs with UART and


USB

Cons:

Custom firmware development

OS driver development (optional only when the


USB is using a class, other than the supported
ones)

Support libraries on the host side needs to be


developed and tested

USB certification costs

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

Why USB to UART


Conversion

Using the standalone solution


MCP2200

Features:

Complete integrated solution (USB-UART


conversion)

GPIO manipulation

256 bytes EEPROM storage

USB events signaling (Suspend state, USB


configured)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

10

Why USB to UART


Conversion

Using the standalone solution


MCP2200

Pros:

No firmware development

No certification costs

Plug & Play solution drivers provided by most


of the Operating Systems

Support libraries and example applications as


part of the support package of the MCP2200

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

11

Why USB to UART


Conversion

Using the standalone solution


MCP2200

Cons:

Add the MCP2200 and its minimal set of


passive components on the PCB or add it
as a module

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

12

Why USB to UART


Conversion

Why choose MCP2200 over PIC


MCU solution (part 1)

Overall savings when using MCP2200

The customer doesnt need to know much


about USB inner workings when using the
MCP2200 time savings - $
The system firmware stays simple (still
using the UART communication) while the
conversion details are handled by
MCP2200 firmware development
savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

13

Why USB to UART


Conversion

Why choose MCP2200 over PIC


MCU solution (part 2)

Overall savings when using MCP2200

No additional costs for VID/PID pair when


using the MCP2200 savings - $
PC side drivers already in place no need
to develop one time savings - $

No costs for MCP2200 USB


certification the MCP2200 is
already certified savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

14

Why USB to UART


Conversion

Why choose MCP2200 over PIC


MCU solution (part 3)

Overall savings when using MCP2200

Support libraries offered for MCP2200;


the PC application development is
shortened time savings - $
MCP2200 cheaper than the entry level PIC
MCU with USB savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

15

Why USB to UART


Conversion

Why choose MCP2200 over PIC


MCU solution conclusion

The overall cost when using a PIC


MCU solution is higher than in the
case of using the MCP2200

PIC MCU price and system development


effort >> MCP2200s price + extra passive
components (7 * savings as above)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

16

Why USB to SPI


Conversion

SPI interface very popular in


embedded world

A large variety of SPI slave chips


No easily accessible SPI interface on
the host PC side
USB interface very popular generalpurpose interface on the host PCs

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

17

Why USB to SPI


Conversion

Microchip offers USB-SPI


interface solutions

PIC MCUs with SPI and USB

Standalone solution MCP2210

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

18

Why USB to SPI


Conversion

Using PIC MCUs with SPI and USB

Features:

Complete integrated solution (includes


USB and SPI peripherals); needs only the
bridge firmware

The target MCU can be used for more


than USB to SPI conversion; the
remaining peripherals can be used for
other purposes

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

19

Why USB to SPI


Conversion

Using PIC MCUs with SPI and USB


Pros:

The custom solution can offer more than


USB to SPI conversion

The MCU used for USB-SPI conversion


can perform the reminder of the system
functionalities

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

20

Why USB to SPI


Conversion

Using PIC MCUs with SPI and USB

Cons:

Custom firmware development

OS driver development (optional only when the


USB is using a class, other than the supported
ones)

Support libraries on the host side needs to be


developed and tested

USB certification costs

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

21

Why USB to SPI


Conversion

Using standalone solution


MCP2210

Features:

Complete integrated solution (USB-SPI


conversion)

GPIO manipulation

256 bytes EEPROM storage

USB events signaling (Suspend state, USB


configured)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

22

Why USB to SPI


Conversion

Using standalone solution


MCP2210

Pros:

No firmware development

No certification costs

Plug & Play solution drivers provided by most


of the Operating Systems

Support libraries and example applications as


part of the support package of the MCP2210

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

23

Why USB to SPI


Conversion

Using standalone solution


MCP2210

Cons:

Add the MCP2200 and its minimal set of


passive components on the PCB or add it
as a module

Bandwidth limited to 64KBytes/s (due to


HID class usage)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

24

Why USB to SPI


Conversion

Why choose MCP2210 over PIC


MCU solution (part 1)

Overall savings when using MCP2210

The customer doesnt need to know much


about USB inner workings when using the
MCP2210 time savings - $
The system firmware stays simple while
the conversion details are handled by
MCP2210 firmware development
savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

25

Why USB to SPI


Conversion

Why choose MCP2210 over PIC


MCU solution (part 2)

Overall savings when using MCP2210

No additional costs for VID/PID pair when


using the MCP2210 savings - $
PC side drivers already in place no need
to develop one time savings - $

No costs for MCP2210 USB


certification the MCP2210 is
already certified savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

26

Why USB to SPI


Conversion

Why choose MCP2210 over PIC


MCU solution (part 3)

Overall savings when using MCP2210

Support libraries offered for MCP2210;


the PC application development is
shortened time savings - $
MCP2210 cheaper than the entry level PIC
MCU with USB savings - $

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

27

Why USB to SPI


Conversion

Why choose MCP2210 over PIC


MCU solution conclusion

The overall cost when using a PIC


MCU solution is higher than in the
case of using the MCP2210

PIC MCU price and system development


effort >> MCP2210s price + extra passive
components (7 * savings as above)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

28

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

29

Introduction to Microchips
USB-UART Standalone
Solution MCP2200

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

30

MCP2200

UART to USB 2.0 Protocol


Converter

Supports full speed USB


Configurable, with 8 general purpose I/O
pins
USB 2.0 Compliant (certified)
Uses 12MHz external clock
Unique Serial number set in factory and
useful in preventing COM port
proliferation

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

31

MCP2200 USB Features

Composite device

HID interface
Chip Configuration
GPIO manipulation
EEPROM storage

CDC interface

Used for USB-UART conversion only

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

32

MCP2200 UART
Features

UART Features:

Supports Baud Rates from 300 bps


1 Mbps
Hardware flow control signals
(RTS/CTS)
Provides polarity options (Tx/Rx and
RTS/CTS signals can be configured
for inverted logic)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

33

MCP2200 Extra Features

Features other than USB-UART


conversion:

Status pins
Bus activity (Tx/Rx LED output)
USB Suspend State - pin signaling
USB Configured State - pin signaling

GPIO manipulation
256 bytes of user EEPROM for
nonvolatile user storage

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

34

MCP2200 Features

USB

GPIO
UART

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

35

MCP2200 Features

USB Driver and Configuration SW

Standard Windows Driver for Virtual


Comm. Port (VCP) through USB-CDC
class driver

Win. XP (SP3), Vista, Win. 7


Linux Kernel 2.4.x, 2.6.x and later

Device configuration utility software

Initial device configuration for

Development
Production

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

36

MCP2200 Configuration
Utility
VID and PID

Configures the
device
2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

37

MCP2200.INF File
Modifications

Put the new


VID/PID

pair in both
places

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

38

MCP2200.INF File
Modifications

Change the
strings to fit
your needs

Leave only this line as is!!!

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

39

MCP2200 Configuration
Utility
VID and PID

Updates the GUI,


Not the device

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

40

MCP2200 Configuration
Utility
Default UART

Alternate pin
functions

GPIO config

String descriptors

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

41

MCP2200 Configuration
Utility

Status window

Configures the
device
2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

42

MCP2200 Production Utility

Load production
configuration

Counter

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

43

MCP2200 New
Configuration Utility

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

44

MCP2200 System
Integration

Integrating the MCP2200 in a


system requires a few steps

A reduced number of passive


components
12MHz resonator or external clock
A few passive components

2 capacitors, 1 resistor

Link the TX/RX and optionally


RTS/CTS
Link some of the GPIOs if necessary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

45

MCP2200 Ecosystem

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

46

MCP2200 System Integration


UART based
system

MCP2200

GPIOs

TX

RX

RX

TX

RTS

CTS

CTS

RTS

GPIOs

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

47

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

48

Demonstration MCP2200

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

49

MCP2200 Evaluation Tool

RS232 to USB evaluation board

Fully powered from USB


Provides test points for I/Os
Data traffic indication LEDs
Software for Device Configuration
Part number:

MCP2200EV-VCP

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

50

USB Interfacing with MCP2200

Okay not
that old.
2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

51

Demo 2 Back to Back


MCP2200EV-VCPs

Tx

Tx

Rx

Rx

USB

USB

RealTerm

Windows PC

RealTerm

Virtual connection

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

52

MCP2200 Breakout Board

USB to UART(not RS232)


evaluation board

Fully powered from USB

Provides test points for I/Os


100mil pin spacing DIP package compatible

Choice for powering the board with 3.3V or 5V (jumper


selectable)
Can provide up to 250mA of current to the rest of the
system

600mil width between the 2 sets of pin colums

UART interface pins compatible with PICkit Serial


Analyzer

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

53

USB Interfacing with MCP2200


MCP2200 Breakout Board
Top side

2011 Microchip Technology Incorporated. All Rights Reserved.

Bottom side

1542 USB3

Slide

54

Demo Adding USB to


PIC16F886
USB

UART signals
PICkit Serial connector

MCP2200
Breakout Board

PIC16F886 28pin
Demo Board

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

55

Demo Adding USB to


PIC16F886
PIC16F886

MCP2200 Breakout Board

RX

TX

TX

RX

USB

Firmware echoes back


the received data

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

56

USB-UART Isolation Board

USB-UART evaluation board

Fully powered from USB


1KV electrical isolation
Provides 5V/200mA (max) on the
isolated side
Data traffic and power presence
LEDs
Part number: TBD

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

57

USB-UART Isolation Board


Example enclosure

MCP2200

Digital
Isolation

UART
4-pin

USB

Isolated power supply


5V/200mA

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

58

Adding USB to PIC16F886


(electrically isolated)
PIC16F886

MCP2200 Isolation board

RX

TX

TX

RX

USB

1KV electrical
isolation
Firmware echoes back
the received data

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

59

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

60

Introduction to Microchips
USB-SPI Standalone
Solution MCP2210

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

61

MCP2210

USB 2.0 to SPI (master) Protocol


Converter

Supports full speed USB


Configurable SPI transfers, with up to
8 chip-selects or general purpose I/O
pins
USB 2.0 Compliant (certified)
Unique Serial number set in factory

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

62

MCP2210 USB Features

Interface - HID only device

Built-in support in all major OS


versions
Maximum transfer rate of 64
KBytes/s maximum achievable
transfer bandwidth
Configurable USB descriptor
parameters (e.g. power option,
required current)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

63

MCP2210 SPI Features

SPI Master features

Fine granularity for choosing SPI


transfer rates

From 1.5 12000 Kb/s

Up to 8 chip-selects can be used for


SPI transfers
Configurable SPI transfer relative
timings

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

64

MCP2210 Storage/Config
Features

EEPROM and configurable chip


settings

256 bytes of user EEPROM


Password protection/Lock for EEPROM
and chip settings access
Can be accessed through USB or as an
emulated SPI EEPROM

The MCP2210 is seen as a slave SPI


EEPROM chip

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

65

MCP2210 Extra Features

Extra Features:

Status pins
Tx/Rx traffic (for LED signaling)
USB Suspend State - pin signaling
USB Configured State - pin signaling

General-purpose I/O pins (up to 8)

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

66

MCP2210 System
Integration

Integrating the MCP2210 in a


system requires a few steps

A reduced number of passive


components
12MHz resonator or external clock
A few passive components

2 capacitors, 1 resistor

Link SPI bus and use up to 8 chipselect pins


Link some of the GPIOs if necessary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

67

MCP2210 Ecosystem

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

68

MCP2210 System Integration


MCP2210

MOSI (SDO)
MISO (SDI)
SCK
CS
GPIOs

Full-duplex
SPI slave chip

Half-duplex
SPI slave chip

SDO
SDI
SCK
CS

SDO/SDI

INT

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

SCK
CS
INT

Slide

69

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

70

Demonstration MCP2210

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

71

MCP2210 Evaluation Board

USB SPI evaluation board

Fully powered from USB


Provides test points for I/Os
Data traffic indication LEDs
PC Utility for power-up device
configuration
Part number:

TBD

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

72

Demo MCP2210EV
PICkit Serial

Adds USB to popular PICkit Serial SPI


Demo Board

Demo application for SPI slave chips


usage

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

73

Demo MCP2210EV
PICkit Serial
MCP2210

Temp. Sensor

MOSI (SDO)

SDO/SDI

MISO (SDI)
SCK
CS

SCK

TC77
CS
GPIOs

EEPROM

12bit ADC

SDO
SDI
SCK
CS

SDO
SDI
SCK
CS

25LC010

2011 Microchip Technology Incorporated. All Rights Reserved.

MCP3201

1542 USB3

I/O Expander
SDO
SDI
SCK
CS
MCP23S08

Slide

74

MCP2210 High Precision


Dual ADC Board

High precision dual ADC

16/24 bits/sample, up to 64 K
Samples/s uses MCP3901 (2ch.
Delta-Sigma ADC)
USB access through MCP2210
Applications
High precision sensor readings
Energy monitoring/metering

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

75

MCP2210 High Precision


Dual ADC Board

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

76

Demo High Precision


Dual ADC Board
Windows PC
Dual Scope - PC demo application

Analog input CH0

USB
Analog input CH1

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

77

Sample Agenda

USB to UART and USB to SPI conversion


Introduction to Microchips USB-UART
standalone solution MCP2200
Demonstration MCP2200
Introduction to Microchips USB-SPI
standalone solution MCP2210
Demonstration MCP2210
Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

78

Summary

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

79

Summary

Today we covered:

MCP2200 as a ready-made USB-UART


solution

Adds USB connectivity to UART based


systems

MCP2210 as a ready-made USB-SPI


(master) bridge

Opens up a new range of possible


applications using the existing SPI chips
portfolio

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

80

Q&A

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

81

Thank you!

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

82

Trademarks

The Microchip name and logo, the Microchip logo, dsPIC, KeeLoq, KeeLoq
logo, MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC 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, MXDEV,
MXLAB, SEEVAL and The Embedded Control Solutions Company are
registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, chipKIT, chipKIT logo,
CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming,
ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK,
mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM,
PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, Total
Endurance, TSHARC, UniWinDriver, WiperLock and ZENA 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.
All other trademarks mentioned herein are property of their respective
companies.
2011, Microchip Technology Incorporated, All Rights Reserved.

2011 Microchip Technology Incorporated. All Rights Reserved.

1542 USB3

Slide

83

Você também pode gostar