Datasheet
256
7593L–AVR–09/12
AT90USB64/128
22.11 ID detection
The ID pin transition is detected thanks to the following architecture:
Figure 22-17. ID detection input block diagram.
The ID pin can be used to detect the USB mode (Peripheral or Host) or software selected. This
allows the UID pin to be used has general purpose I/O even when USB interface is enable.
When the UID pin is selected, by default, (no A-plug or B-plug), the macro is in the Peripheral
mode (internal pull-up). The IDTI interrupt is triggered when a A-plug (Host) is plugged or
unplugged. The interrupt is not triggered when a B-plug (Periph) is plugged or unplugged.
ID detection is independent of USB global interface enable.
22.12 Registers description
22.12.1 USB general registers
• 7 – UIMOD: USB Mode bit
This bit has no effect when the UIDE bit is set (external UID pin activated). Set to enable the
USB device mode. Clear to enable the USB host mode
• 6 – UIDE: UID pin Enable
Set to enable the USB mode selection (peripheral/host) through the UID pin. Clear to enable the
USB mode selection (peripheral/host) with UIMOD bit register.
UIDE should be modified only when the USB interface is disabled (USBE bit cleared).
• 5 – Reserved
The value read from this bit is always 0. Do not set this bit.
• 4 – UVCONE: UVCON pin Enable
Set to enable the UVCON pin control. Clear to disable the UVCON pin control. This bit should be
set only when the USB interface is enable.
R
PU
UIMOD
UHWCON.7
UID
ID
USBSTA.1
Internal pull up
VDD
UIDE
UHWCON.6
1
0
Bit 7 6 5 4 321 0
UIMOD UIDE UVCONE UVREGE UHWCON
Read/write R/W R/W R R/W R R R R/W
Initial value 1 0 0 0 0 0 0 0