Data Sheet

748
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181G–SAM-D21_Datasheet–09/2015
31.6 Functional Description
31.6.1 USB General Operation
31.6.1.1 Initialization
After a hardware reset, the USB is disabled. The user should first enable the USB (CTRLA.ENABLE) in either device
mode or host mode (CTRLA.MODE).
Figure 31-2. General States
After a hardware reset, the USB is in the idle state. In this state:
z The module is disabled. The USB Enable bit in the Control A register (CTRLA.ENABLE) is reset.
z The module clock is stopped in order to minimize power consumption.
z The USB pad is in suspend mode.
z The internal states and registers of the device and host are reset.
Before using the USB, the Pad Calibration register (PADCAL) must be loaded with production calibration values from the
NVM Software Calibration Area. Refer to “NVM Software Calibration Area Mapping” on page 31 for further details.
The USB is enabled by writing a one to CTRLA.ENABLE. The USB is disabled by writing a zero to CTRLA.ENABLE.
The USB is reset by writing a one to the Software Reset bit in CTRLA (CTRLA.SWRST). All registers in the USB will be
reset to their initial state, and the USB will be disabled. Refer to the CTRLA register for details.
The user can configure pads and speed before enabling the USB by writing to the Operating Mode bit in the Control A
register (CTRLA.MODE) and the Speed Configuration field in the Control B register (CTRLB.SPDCONF). These values
are taken into account once the USB has been enabled by writing a one to CTRLA.ENABLE.
Host
CTRLA.ENABLE = 0
CTRLA.ENABLE = 1
CTRLA.MODE = 1
Device
CTRLA.ENABLE = 0
CTRLA.ENABLE = 1
CTRLA.MODE = 0
Any state
HW RESET | CTRLA.SWRST
Idle