Datasheet

Section 14 Universal Serial Bus (USB)
Rev.7.00 Dec. 24, 2008 Page 498 of 698
REJ09B0074-0700
14.5.2 USB Cable Connection/Disconnection
(1) USB Cable Connection (When USB module stop or power-down mode is not used)
If the USB cable enters the connection state from the disconnection state in an application (self
powered) where USB module stop or power-down mode is not used, perform the operation as
shown in figure 14.3. In bus-powered mode, perform the operation according to note 2 in
figure 14.3.
Connect the USB cable
USB function
Firmware
Receive bus reset from the host
Bus reset interrupt occurs.
A VBUS interrupt occurs
Check if VBUSs in UIFR3
is set to 1
Enable D+ pull-up
by port 36 (P36)
Check the USB cable
connection state
Initialize the firmware
Yes
No
Wait for a setup interrupt
Cancel UDC core reset
(Clear UDCRST in UCTLR to 0)
Clear all FIFOs
Clear VBUSi in UIFR3
System ready?
Set USB module operation
*
1
*
2
EXIRQx
EXIRQx
Notes: 1. VBUS interrupts in the USB module cannot be detected in power-down mode or
in the USB module stop state.
2. In bus-powered mode, power is applied after the USB cable has been connected.
Accordingly, immediately after completing the power-on reset, initialization (14.5.1), clearing all FIFOs,
and system preparation, enable the D+ pull-up by the port 36 (P36) and cancel the UDC core reset state.
from 14.5.1
After completing the bus-
powered mode initialization
Figure 14.3 USB Cable Connection
(When USB Module Stop or Power-Down Mode Is not Used)