Course M332
Advanced C USB Device Programming for Microchip Developers (for experienced C Programmers)
Advanced C USB Device Programming for Microchip Developers (for experienced C Programmers)
Duration: 5 Days
Intended Audience
The Workshop Covers USB device programming and application development using PIC18, PIC24 and PIC32 USB devices. The emphasis is on developing practical applications as well as practical "gadgets". ///
Attendees are expected to have some familiarity with C programming, as well as some experience of working on embedded systems.
Course Overview
The course will provide an introduction to programming USB devices in PIC based applications. The course will deal with a range of Microchip microcontrollers with on chip USB hardware, PIC18, PIC24 and PIC32 devices will be covered. The emphasis will be on practical applications covering Human Interface Device (HID), Communication Class Device (CDC) and Mass Storage device classes. The course will also cover usage of USB Protocol analysers for testing, debugging and reverse engineering of USB application protocols.
Key Skills
On completing the course delegates will
- Have a good basic understanding of the USB 1.x and 2 standards
- Know how to use USB Protocol analysers in troubleshooting and debugging USB application problems
- Be able to work with the Microchip USB libraries
- Be able to implement USB based applications for control, data logging and data acquisition
Course Contents
Overview of USB
- History of USB
- Uses, benefits and limitations of USB
- Evolution of USB Standards - USB 1.0, USB 1.1, USB 2.0, USB 3.0, USB On-The-Go, Wireless USB
- Overview of USB Transfers and Transactions
USB Transfer Types
- Control transfers
- Bulk transfers
- Interrupt transfers
- Isochronous transfers
- Time-critical transfers
Device Enumeration - How the host learns about devices
- The enumeration process
- Device insertion and removal
- Interfaces and descriptors
Control Transfers
- Structure of the control transfer process
- Standard USB requests
- Class-Specific requests
- Vendor-Defined requests
Microchip USB Devices and associated firmware
- PIC18 USB devices
- PIC24 USB devices
- PIC32 USB devices
Understanding Host Communication with a USB Device
- USB Windows device driver model
- Linux USB device driver model
- Kernel mode vs. user mode drivers
- How a driver is matched to a device
- How a device is detected
Human Interface Devices
- Overview of HID
- HID Reports
- HID case studies
- HID compliant consumer control devices
- Case study - Phidget like HID devices
- Case study - Velleman USB Interface boards (K8055, K8061)
Mass Storage Device Implementation
- Overview of SD Card technology
- Adding SD card support to Microchip applications
- Microchip File system and FAT32 filesystem firmware
- Case study - USB mass storage device implementation
Implementing Communication Class Devices (CDC) using Microchip Controllers
- Microchip devices supporting On-The-Go (OTG) technology
- Implementing CDC devices using Microchip microcontrollers supporting OTG
- Case study - implementing a USB device that functions as a "virtual UART"
USB - Bootloaders
- Overview of Bootloaders
- Case study - Implementation of a USB bootloader for a Microchip microcontroller
