Datasheet
246
7593L–AVR–09/12
AT90USB64/128
22.4 General operating modes
22.4.1 Introduction
After a hardware reset, the USB controller is disabled. When enabled, the USB controller has to
run the Device Controller or the Host Controller. This is performed using the USB ID detection.
• If the ID pin is not connected to ground, the USB ID bit is set by hardware (internal pull up on
the UID pad) and the USB Device controller is selected
• The ID bit is cleared by hardware when a low level has been detected on the ID pin. The
Device controller is then disabled and the Host controller enabled
The software anyway has to select the mode (Host, Device) in order to access to the Device
controller registers or to the Host controller registers, which are multiplexed. For example, even
if the USB controller has detected a Device mode (pin ID high), the software shall select the
device mode (bit HOST cleared), otherwise it w ill access to the host registers. This is also true
for the Host mode.
Note: For the Atmel AT90USB646/1286 products the Host mode is not included in the USB controller,
and the ID pin is not used and should be configured and used as a general I/O.
22.4.2 Power-on and reset
The next diagram explains the USB controller main states on power-on:
Figure 22-9. USB controller states after reset.
USB Controller state after an hardware reset is ‘Reset’. In this state:
• USBE is not set
• the USB controller clock is stopped in order to minimize the power consumption (FRZCLK=1)
• the USB controller is disabled
• the USB pad is in the suspend mode
• the Host and Device USB controllers internal states are reset
After setting USBE, the USB Controller enters in the Host or in the Device state (according to the
USB ID pin). The selected controller is ‘Idle’.
The USB Controller can at any time be ‘stopped’ by clearing USBE. In fact, clearing USBE acts
as an hardware reset.
Device
Reset
USBE=0
<any other
state>
USBE=1
ID= 1
Clock stopped
FRZCLK=1
Macro off
USBE=0
USBE=0
Host
USBE=0
H W
RESET
USBE=1
ID= 0
AT 90USB647/ 1287 only
AT 90USB646/ 1286 forced mode