SlideShare a Scribd company logo
1 of 16
Using the PSoC USB




       March 17, 2012
Lloyd Moore, President/Owner
Overview
 USB Background
 USB Standard Classes

 Endpoints and Transfer Types

 Enumeration

 USB Descriptors

 Example Project
USB Background
   Star topology, master / slave architecture
    • Host is the master, initiates all communications
   Multiple speeds: Low=1.5Mbps, Full=12
    Mbps, High=480Mbps, Super=5Gbps
   Self powered vs. Bus powered
    •   Low power: 100mA or 150mA Max (USB 2,3)
    •   High power: 500mA or 900mA Max (USB 2,3)
   Vendor Id, Product Id, serial number
    uniquely identify each device
Standard USB Classes
                         Audio                    Speakers, microphone,
   Used to define the                            MIDI

    USB device.          Communication (CDC)      Virtual Serial Port, modem,
                                                  Ethernet
   Standardizes         Content Security         File and resource access

    protocols and        Firmware Upgrade (DFU)   Device software upgrades

    drivers for          Human Interface (HID)    Keyboards, mice, joysticks,
                                                  barcode scanners, UPS
    common devices.      IrDA Bridge              IR communications
   Allows operating     Mass Storage             Hard drives, DVD, flash

    systems to           Personal Healthcare
                                                  memory
                                                  Heart rate, blood pressure,
    provide default                               glucose meters, ect.

    drivers.             Printer                  Printers – ya that simple!

                         Smart Card               Phone cards, keyless entry
   Can also create      Still Image Capture      Cameras, scanners
    vendor specific      Test & Measurement       ADC, DAC, sensors, etc.
    classes for custom   Video                    Video cameras, web cams
    applications.
Endpoints

   Uniquely addressable portion of a USB device.
   4 end points max for a low speed device, 16 for
    other speeds
   End point 0 is special, must be present and is
    used for enumeration and control
   Data transfer happens at end points.
   Simplest way to think about an end point is that
    it provides an addressable buffer to send and
    receive data.
   IN refers to dataflow TO the Host
   OUT refers to dataflow FROM the Host
Transfer Types

Type          Guarantees      Typical Use

Control       Presence,       Device id and
              Error Free      configuration
Bulk          Error Free      Printer, hard
                              drive
Interrupt     Latency         Keyboard,
              Error Free      mouse
Isochronous   Delivery rate   Streaming
                              audio & video
Enumeration
   Process by which the host discovers what devices
    are connected and the properties of those
    devices.
   Utilizes a series of resets and Control transfers to
    end point 0.
   Each device given a unique address between 1
    and 127.
   Power and bandwidth requirements are collected
    and allocated.
    • Device will not be “connected” if resources are not
      available.
   Communication details collected by way of
    “descriptors”
Descriptors
   Data structures which allow the host to
    learn about a device and how to
    communicate with it.
   Essentially a language which defines the
    protocol between the host and each
    device.
   Can be quite complex but standard
    descriptors are well defined.
   Standard device drivers can interpret
    these for a wide range of devices.
Example Project
   Configure a PSoC 5 to send data from the
    CapSense buttons and slider to a PC in the
    form of a joystick.
   Will be using the CY8CKIT-001, and PSoC
    Creator 1.0 for this demo.
    • Upgraded LCD display Lumex LCM-S02004DSR
    • If using PSoC Creator 2.0 will also need to add
      24Mhz crystal to bottom of processor module
      due to a tighter clock requirement.
   Data will be shown on LCD as well as sent
    to PC.
   Will be using a “canned” set of code as the
    configuration is pretty time consuming.
Hardware Configuration


   DebugLcd used to control the LCD display
   CapSense will run the CapSense buttons
    and slider control for input
    • Heavy filtering here as the demo board USB
      spews lots of noise to CapSense when running.
   USBFS – USB 2.0 Full Speed driver, will
    configure this to be a Joystick HID device
    to send information to the PC.
Device Descriptor
   Walkthrough live configuration of
    descriptor.
Clock Configuration




     IMO = 24.000 MHz
     USB = IMOx2
     ILO = 100KHz
USB Initialization Code


 USBFS_Start() configures the
  hardware
 Next we wait while the USB device

  goes through enumeration
 Finally prepare the first set of data to

  be dropped to the host when
  requested
Main Loop




   General operational pattern is to wait for
    Host to grab data currently at the end
    point, then replace it.
   USBFS_bGetEPAckState() waits for grab
   USBFS_LoadInEP() loads next batch of
    data to be grabbed by the host
Resources
   Book: USB Complete, Fourth Edition
    • Jan Axelson
    • ISBN: 978-1-931448-08-6
   PSoC Application notes: AN57294, AN57473, AN58726
   PSoC Product Web Site:
    •   http://www.cypress.com/?id=1353
   PSoC Developer Community:
    • http://www.psocdeveloper.com/forums/
   PSoC Training On Demand:
    • http://www.cypress.com/training
   PSoC Full Development Kit (1, 3, 5): $249
    • http://www.cypress.com/?rID=37464
   My Contact Info:
    • Lloyd@CyberData-Robotics.com
    • http://www.CyberData-Robotics.com
Questions????

 Will be around a bit after the
  meeting for individual questions
 Feel free to e-mail me

More Related Content

What's hot

Computer Basics
Computer BasicsComputer Basics
Computer Basicsnhumar
 
Computer hardware-ports-connectors
Computer hardware-ports-connectorsComputer hardware-ports-connectors
Computer hardware-ports-connectorsRoshan sp
 
Internal components - Technical
Internal components - TechnicalInternal components - Technical
Internal components - Technicallukasgoda456
 
Building a computer in virtual desktop.
Building a computer in virtual desktop.Building a computer in virtual desktop.
Building a computer in virtual desktop.OriginalGSM
 
BadUSB — On accessories that turn evil by Karsten Nohl
BadUSB — On accessories that turn evil by Karsten NohlBadUSB — On accessories that turn evil by Karsten Nohl
BadUSB — On accessories that turn evil by Karsten NohlPriyanka Aash
 
Computer Devices that are Both Input & Output Devices
Computer Devices that are Both Input & Output DevicesComputer Devices that are Both Input & Output Devices
Computer Devices that are Both Input & Output DevicesAngela DeHart
 
Computer components checklist
Computer components checklistComputer components checklist
Computer components checklistkaleb Furstenberg
 
Hardware basics: peripherals
Hardware basics: peripheralsHardware basics: peripherals
Hardware basics: peripheralsMiguel Rebollo
 
10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)Akhila Dakshina
 
Input devices , output devices & storage devices
Input devices , output devices & storage devicesInput devices , output devices & storage devices
Input devices , output devices & storage deviceszamzulaiha
 
Mcomputing l130-l230[ncomputing.123vietnam.vn]
Mcomputing l130-l230[ncomputing.123vietnam.vn]Mcomputing l130-l230[ncomputing.123vietnam.vn]
Mcomputing l130-l230[ncomputing.123vietnam.vn]Gia sư Đức Trí
 
2018 all lens bag of tricks v1.2
2018 all lens bag of tricks v1.22018 all lens bag of tricks v1.2
2018 all lens bag of tricks v1.2Len Noe
 
input & output devices
input & output devicesinput & output devices
input & output devicesRajat Singla
 
project on input output devie
project on input output devieproject on input output devie
project on input output devieRaunak Sodhi
 
Computer System
Computer SystemComputer System
Computer Systemapolets
 
Peripheral devices
Peripheral devicesPeripheral devices
Peripheral devicesandy_s_king
 
BadUSB, and what you should do about it
BadUSB, and what you should do about itBadUSB, and what you should do about it
BadUSB, and what you should do about itrobertfisk
 

What's hot (20)

Computer Basics
Computer BasicsComputer Basics
Computer Basics
 
Computer
ComputerComputer
Computer
 
Computer hardware-ports-connectors
Computer hardware-ports-connectorsComputer hardware-ports-connectors
Computer hardware-ports-connectors
 
Internal components - Technical
Internal components - TechnicalInternal components - Technical
Internal components - Technical
 
Building a computer in virtual desktop.
Building a computer in virtual desktop.Building a computer in virtual desktop.
Building a computer in virtual desktop.
 
BadUSB — On accessories that turn evil by Karsten Nohl
BadUSB — On accessories that turn evil by Karsten NohlBadUSB — On accessories that turn evil by Karsten Nohl
BadUSB — On accessories that turn evil by Karsten Nohl
 
Computer Devices that are Both Input & Output Devices
Computer Devices that are Both Input & Output DevicesComputer Devices that are Both Input & Output Devices
Computer Devices that are Both Input & Output Devices
 
Computer components checklist
Computer components checklistComputer components checklist
Computer components checklist
 
BAD USB 2.0
BAD USB 2.0BAD USB 2.0
BAD USB 2.0
 
Hardware basics: peripherals
Hardware basics: peripheralsHardware basics: peripherals
Hardware basics: peripherals
 
10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)
 
Input devices , output devices & storage devices
Input devices , output devices & storage devicesInput devices , output devices & storage devices
Input devices , output devices & storage devices
 
Mcomputing l130-l230[ncomputing.123vietnam.vn]
Mcomputing l130-l230[ncomputing.123vietnam.vn]Mcomputing l130-l230[ncomputing.123vietnam.vn]
Mcomputing l130-l230[ncomputing.123vietnam.vn]
 
2018 all lens bag of tricks v1.2
2018 all lens bag of tricks v1.22018 all lens bag of tricks v1.2
2018 all lens bag of tricks v1.2
 
input & output devices
input & output devicesinput & output devices
input & output devices
 
project on input output devie
project on input output devieproject on input output devie
project on input output devie
 
Computer System
Computer SystemComputer System
Computer System
 
Computer Peripheral
Computer PeripheralComputer Peripheral
Computer Peripheral
 
Peripheral devices
Peripheral devicesPeripheral devices
Peripheral devices
 
BadUSB, and what you should do about it
BadUSB, and what you should do about itBadUSB, and what you should do about it
BadUSB, and what you should do about it
 

Similar to PSoC USB HID

Similar to PSoC USB HID (20)

Input
InputInput
Input
 
Personal computer-hardware
Personal computer-hardwarePersonal computer-hardware
Personal computer-hardware
 
Choosing_(and_Implem..
Choosing_(and_Implem..Choosing_(and_Implem..
Choosing_(and_Implem..
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Computer basics
Computer basicsComputer basics
Computer basics
 
E 1-00powerpointpresentationupdate-090901115018-phpapp01
E 1-00powerpointpresentationupdate-090901115018-phpapp01E 1-00powerpointpresentationupdate-090901115018-phpapp01
E 1-00powerpointpresentationupdate-090901115018-phpapp01
 
BASIC COMPUTER ELEMENTS.pptx
BASIC COMPUTER ELEMENTS.pptxBASIC COMPUTER ELEMENTS.pptx
BASIC COMPUTER ELEMENTS.pptx
 
Lecture 02 Mobile hardware
Lecture 02 Mobile hardwareLecture 02 Mobile hardware
Lecture 02 Mobile hardware
 
Hardware software comparisom
Hardware software comparisomHardware software comparisom
Hardware software comparisom
 
hardware software basics
hardware software basicshardware software basics
hardware software basics
 
Computer Hardware-01.ppt
Computer Hardware-01.pptComputer Hardware-01.ppt
Computer Hardware-01.ppt
 
Peripherals
PeripheralsPeripherals
Peripherals
 
Network
NetworkNetwork
Network
 
Hardware
HardwareHardware
Hardware
 
Hardware and Software Basics With Dr. Poirot
Hardware and Software Basics With Dr. PoirotHardware and Software Basics With Dr. Poirot
Hardware and Software Basics With Dr. Poirot
 
Hwswb
HwswbHwswb
Hwswb
 
Lec no. 4 hardware and software basic
Lec no. 4 hardware and software basicLec no. 4 hardware and software basic
Lec no. 4 hardware and software basic
 
Basic of computers
Basic of computersBasic of computers
Basic of computers
 
Basics
BasicsBasics
Basics
 
ICT 1
ICT 1ICT 1
ICT 1
 

More from LloydMoore

Less Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposalLess Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposalLloydMoore
 
Debugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How ToDebugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How ToLloydMoore
 
Successful Software Projects - What you need to consider
Successful Software Projects - What you need to considerSuccessful Software Projects - What you need to consider
Successful Software Projects - What you need to considerLloydMoore
 
A Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming languageA Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming languageLloydMoore
 
What Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniquesWhat Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniquesLloydMoore
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi roboticsLloydMoore
 
High Reliabilty Systems
High Reliabilty SystemsHigh Reliabilty Systems
High Reliabilty SystemsLloydMoore
 
Real Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't doReal Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't doLloydMoore
 
Using PSoC Creator
Using PSoC CreatorUsing PSoC Creator
Using PSoC CreatorLloydMoore
 
Using the Cypress PSoC Processor
Using the Cypress PSoC ProcessorUsing the Cypress PSoC Processor
Using the Cypress PSoC ProcessorLloydMoore
 
C for Microcontrollers
C for MicrocontrollersC for Microcontrollers
C for MicrocontrollersLloydMoore
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry PiLloydMoore
 

More from LloydMoore (12)

Less Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposalLess Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposal
 
Debugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How ToDebugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How To
 
Successful Software Projects - What you need to consider
Successful Software Projects - What you need to considerSuccessful Software Projects - What you need to consider
Successful Software Projects - What you need to consider
 
A Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming languageA Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming language
 
What Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniquesWhat Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniques
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
 
High Reliabilty Systems
High Reliabilty SystemsHigh Reliabilty Systems
High Reliabilty Systems
 
Real Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't doReal Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't do
 
Using PSoC Creator
Using PSoC CreatorUsing PSoC Creator
Using PSoC Creator
 
Using the Cypress PSoC Processor
Using the Cypress PSoC ProcessorUsing the Cypress PSoC Processor
Using the Cypress PSoC Processor
 
C for Microcontrollers
C for MicrocontrollersC for Microcontrollers
C for Microcontrollers
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

PSoC USB HID

  • 1. Using the PSoC USB March 17, 2012 Lloyd Moore, President/Owner
  • 2. Overview  USB Background  USB Standard Classes  Endpoints and Transfer Types  Enumeration  USB Descriptors  Example Project
  • 3. USB Background  Star topology, master / slave architecture • Host is the master, initiates all communications  Multiple speeds: Low=1.5Mbps, Full=12 Mbps, High=480Mbps, Super=5Gbps  Self powered vs. Bus powered • Low power: 100mA or 150mA Max (USB 2,3) • High power: 500mA or 900mA Max (USB 2,3)  Vendor Id, Product Id, serial number uniquely identify each device
  • 4. Standard USB Classes Audio Speakers, microphone,  Used to define the MIDI USB device. Communication (CDC) Virtual Serial Port, modem, Ethernet  Standardizes Content Security File and resource access protocols and Firmware Upgrade (DFU) Device software upgrades drivers for Human Interface (HID) Keyboards, mice, joysticks, barcode scanners, UPS common devices. IrDA Bridge IR communications  Allows operating Mass Storage Hard drives, DVD, flash systems to Personal Healthcare memory Heart rate, blood pressure, provide default glucose meters, ect. drivers. Printer Printers – ya that simple! Smart Card Phone cards, keyless entry  Can also create Still Image Capture Cameras, scanners vendor specific Test & Measurement ADC, DAC, sensors, etc. classes for custom Video Video cameras, web cams applications.
  • 5. Endpoints  Uniquely addressable portion of a USB device.  4 end points max for a low speed device, 16 for other speeds  End point 0 is special, must be present and is used for enumeration and control  Data transfer happens at end points.  Simplest way to think about an end point is that it provides an addressable buffer to send and receive data.  IN refers to dataflow TO the Host  OUT refers to dataflow FROM the Host
  • 6. Transfer Types Type Guarantees Typical Use Control Presence, Device id and Error Free configuration Bulk Error Free Printer, hard drive Interrupt Latency Keyboard, Error Free mouse Isochronous Delivery rate Streaming audio & video
  • 7. Enumeration  Process by which the host discovers what devices are connected and the properties of those devices.  Utilizes a series of resets and Control transfers to end point 0.  Each device given a unique address between 1 and 127.  Power and bandwidth requirements are collected and allocated. • Device will not be “connected” if resources are not available.  Communication details collected by way of “descriptors”
  • 8. Descriptors  Data structures which allow the host to learn about a device and how to communicate with it.  Essentially a language which defines the protocol between the host and each device.  Can be quite complex but standard descriptors are well defined.  Standard device drivers can interpret these for a wide range of devices.
  • 9. Example Project  Configure a PSoC 5 to send data from the CapSense buttons and slider to a PC in the form of a joystick.  Will be using the CY8CKIT-001, and PSoC Creator 1.0 for this demo. • Upgraded LCD display Lumex LCM-S02004DSR • If using PSoC Creator 2.0 will also need to add 24Mhz crystal to bottom of processor module due to a tighter clock requirement.  Data will be shown on LCD as well as sent to PC.  Will be using a “canned” set of code as the configuration is pretty time consuming.
  • 10. Hardware Configuration  DebugLcd used to control the LCD display  CapSense will run the CapSense buttons and slider control for input • Heavy filtering here as the demo board USB spews lots of noise to CapSense when running.  USBFS – USB 2.0 Full Speed driver, will configure this to be a Joystick HID device to send information to the PC.
  • 11. Device Descriptor  Walkthrough live configuration of descriptor.
  • 12. Clock Configuration IMO = 24.000 MHz USB = IMOx2 ILO = 100KHz
  • 13. USB Initialization Code  USBFS_Start() configures the hardware  Next we wait while the USB device goes through enumeration  Finally prepare the first set of data to be dropped to the host when requested
  • 14. Main Loop  General operational pattern is to wait for Host to grab data currently at the end point, then replace it.  USBFS_bGetEPAckState() waits for grab  USBFS_LoadInEP() loads next batch of data to be grabbed by the host
  • 15. Resources  Book: USB Complete, Fourth Edition • Jan Axelson • ISBN: 978-1-931448-08-6  PSoC Application notes: AN57294, AN57473, AN58726  PSoC Product Web Site: • http://www.cypress.com/?id=1353  PSoC Developer Community: • http://www.psocdeveloper.com/forums/  PSoC Training On Demand: • http://www.cypress.com/training  PSoC Full Development Kit (1, 3, 5): $249 • http://www.cypress.com/?rID=37464  My Contact Info: • Lloyd@CyberData-Robotics.com • http://www.CyberData-Robotics.com
  • 16. Questions????  Will be around a bit after the meeting for individual questions  Feel free to e-mail me