Rainbow Electronics AT89C5131 User Manual
Page 129

129
AT89C5131
4136A–USB–03/03
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 will set to 1 the RMWUPE bit in the USB-
CON register to enable this functionality. RMWUPE value will 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 will then clear the
SDRMWUP bit.
Figure 60. Example of REMOTE WAKEUP Management
USB Controller Init
Detection of a SUSPEND State
SPINT
Set RMWUPE
Suspend Management
Enable Clocks
Upstream RESUME Sent
UPRSM
Clear SPINT
Set SDMWUP
Clear SDRMWUP
SET_FEATURE: DEVICE_REMOTE_WAKEUP
Need USB Resume
UPRSM = 1