# USB Device Enumeration Example 1.4

## Purpose

The "USB Core" example project illustrates how to use the USB device framework provided by Atmel to create a simple USB application.

## Hardware Requirements

This package can be used with the following Atmel evaluation boards:

- AT91SAM7S-EK (except AT91SAM7S32)
- AT91SAM7X-EK
- AT91SAM7SE-EK
- AT91SAM7A3-EK
- AT91SAM9260-EK
- AT91SAM9261-EK
- AT91SAM9263-EK
- AT91SAM9RL-EK
- AT91SAM9XE-EK
- AT91SAM9G20-EK

## Description

The software performs the USB enumeration phase by sending simple descriptors to the host computer. On Microsoft Windows, this is enough to have the operating system detect the device and try to install it, despite having no functionality at all.

To verify that the enumeration is done properly, the USB framework output debug traces through the DBGU. Here is the output produced by a normal execution of the application:

> `-- USB Device Enumeration Project 1.4 --
> USB initialization
> USBD_Init
> Connecting device
> Conn Conn Hlr Res
> Hlr Res
> Hlr EoBRes CfgEpt0
> Hlr Susp
> Hlr Res
> Hlr EoBRes CfgEpt0
> Hlr Ept0 Stp Std gDesc Dev Write0(18)
> Hlr Ept0 Wr 18 EoT
> Hlr Ept0 Rd Ack
> Hlr EoBRes CfgEpt0
> Hlr Ept0 Stp Std sAddr Write0(0)
> Hlr Ept0 Wr 0 EoT SetAddr(1)
> Hlr Ept0 Stp Std gDesc Dev Write0(18)
> Hlr Ept0 Wr 18 EoT
> Hlr Ept0 Rd Ack
> Hlr Ept0 Stp Std gDesc Cfg Write0(9)
> Hlr Ept0 Wr 9 EoT
> Hlr Ept0 Rd Ack
> Hlr Ept0 Stp Std gDesc Cfg Write0(20)
> Hlr Ept0 Wr 20 EoT
> Hlr Ept0 Rd Ack
> Hlr Ept0 Stp Std gDesc Qua Stall0
> Hlr Ept0 Sta
> Hlr Susp
> `

WARNING: on the SAM7X/XC evaluation kit, the project only works in internal flash.

## Usage

1. Build the program and download it inside the evaluation board. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User Guide, depending on your chosen solution.
2. On the computer, open the DBGU port with a terminal application (e.g. HyperTerminal on Microsoft Windows).

- Settings: 115200 bauds, 8 bits, 1 stop bit, no parity, no flow control.

3. Start the application.
4. In the terminal window, the following text should appear:

> `-- USB Device Enumeration Project 1.4 --`

5. Connect the USB cable to the board. Traces should start to appear on the terminal. Eventually, the operating system will report that an unknown device has been detected, and may try to install it.

###### Atmel Corporation ©2008