Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ASF USB host CDC

Human interface on SAM3X-EK:

Introduction

This example shows how to implement a USB host CDC on Atmel MCU with USB module.

Startup

After loading firmware, connect the board (EVKxx,Xplain,...) to a USB device CDC. The example is a bridge between a USART from the main MCU and the USB host CDC interface.

  • SAM3X USART used UART on J11 connector
  • Led 3 (D5, red) is on when USB OTG cable is plugged in and Vbus is present
  • Led 1 (D4, green) is continuously on when a device is connected
  • Led 0 (D2, blue) blinks when USB host has checked and enabled CDC interface
    • The blink is slow (1s) with low speed device
    • The blink is normal (0.5s) with full speed device
    • The blink is fast (0.25s) with high speed device
  • Led 2 (D3, amber) is on during data transfer between CDC and UART

About example

The example uses the following module groups:

  • Basic modules: Startup, board, clock, interrupt, power management
  • USB host stack and CDC modules:
    services/usb/
    services/usb/uhc/
    services/usb/class/cdc/host/
  • Specific implementation:
    • main.c,
      initializes clock
      initializes interrupt
      manages UI
    • specific implementation for each target "./examples/product_board/":
      • conf_foo.h configuration of each module
      • ui.c implement of user's interface (buttons, leds)