Interrupt Service Routine (ISR) Flowcharts
13-100
13.6.8 USB Reset Interrupt Handler
When a USB reset occurs, the USB module generates a general USB interrupt
to the local host (see Figure 13–24 and Figure 13–25). The local host
responds to this interrupt by performing the following operations:
-
Cancels any ongoing USB transaction and/or control transfer handling
-
Clears any copies that the application has of configuration number or of
alternate interface numbers
-
Clears any application-specific information relating to halted endpoints
-
Clears any application-specific information relating to the remote wake
enable flag
-
Clears any application-specific information relating to the suspend mode
flag
-
Clears any application-specific copy of the frame number
13.6.9 Suspend/Resume Interrupt Handler
When a USB suspend/resume general USB interrupt occurs (see
Figure 13–26), the USB module has either entered or left suspend mode. The
local host code must determine which and react appropriately.
The suspend sense hardware is implemented to trigger only after 5 ms of bus
IDLE. This forces compliance with the USB Spec Version 1.1 t
WTRSM
timing
parameter (3 ms of IDLE to identify suspend, 2 ms before remote device can
signal resume).
If the local host wants to wake the device from suspend mode and remote
wakeup enable is set (bit R_WK_OK = 1), it must first turn its clock on (if
stopped) then set the Rmt_Wkp. The device then resumes.
If shutoff is enabled (the SOFF_Dis = 0), the 48-MHz clock is automatically
shut off at suspend and turned on at resume (USB host or local host driven).
Setting the SOFF_Dis bit is part of the device configuration; however, the local
host can modify its value at suspend interrupt time if necessary.
13.6.10
Parsing the Non-Isochronous Endpoint-Specific Interrupt
The endpoint-specific interrupt ISR (Figure 13–27) must parse the interrupt
identifier registers IRQ_SRC to determine the interrupts that are active
(EPn_RX, EPn_TX, or both). The two interrupts can be active at any time, and
must be dealt with by the ISR before returning from the ISR. The ISR must then
read EPN_STAT register to determine the endpoint causing the interrupt. For
each direction, only one endpoint interrupt can be active at a time.