Upstream resume – Rainbow Electronics AT89C5122 User Manual
Page 112

112
AT8xC5122/23
4202E–SCR–06/06
Figure 59. Example of a Suspend/Resume Management
Upstream Resume
A USB device can be allowed by the Host to send an upstream resume for Remote
Wake-up purpose.
W h e n t h e U S B c o n t r o l l e r r e c e i v e s t h e S E T _ F E A T U R E r e q u e s t :
DEVICE_REMOTE_WAKEUP, the firmware should set to 1 the RMWUPE bit in the
USBCON register to enable this function. RMWUPE value should be 0 in the other
cases.
If the device is in SUSPEND mode, the USB controller can send an upstream resume by
clearing first the SPINT bit in the USBINT register and by setting then to 1 the SDRM-
WUP bit in the USBCON register. The USB controller sets to 1 the UPRSM bit in the
USBCON register. All clocks must be enabled first. The Remote Wake is sent only if the
USB bus was in Suspend state for at least 5 ms. When the upstream resume is com-
pleted, the UPRSM bit is reset to 0 by hardware. The firmware should then clear the
SDRMWUP bit.
USB Controller Init
Detection of a SUSPEND State
SPINT
Set SUSPCLK
Disable PLL
microcontroller in power-down
Detection of a RESUME State
WUPCPU
Enable PLL
Clear SUSPCLK
Clear WUPCPU bit
Clear SPINT
Note :
WUPCPU bit must be
Cleared before enabling
the PLL
Put the USB pads
in power down mode