Datasheet

Table Of Contents
Section 15 Universal Serial Bus Interface (USB)
REJ09B0140-0900 Rev. 9.00 Page 553 of 846
Sep 16, 2010
H8S/2215 Group
(2) Suspend and Resume Interrupt Processing
Figure 15.9 is a flowchart of suspend and resume interrupt processing.
USB function
Firmware
Resume interrupt
processing
USB operating clock stabilization
detection interrupt processing
SOF interrupt processing
Suspend interrupt
processing
Start USB operating
clock oscillation
Receive SOF
Start SOF marker function
Detect SOF packet
An interrupt occurs
A USB operating clock
stabilization detection
interrupt occurs
Clear USB module
stop mode
(Clear MSTPB0
in MSTPCRB to 0)
Clear resume flag
(Clear SPRSi in UIFR3
to 0)
Clear USB operating clock
stabilization detection flag
(Clear CK48READY
in UIFR3 to 0)
Clear SOF packet
detection flag
(Clear SOF in UIFR3 to 0)
Enable SIF marker
function
(Set SFME in UCTLR to 1)
Resume main process
Prohibit IRQ6
(Clear IRQ6E in IER to 0)
Clear suspend flag
(Clear SPRSi in UIFR3
to 0)
Clear suspend flag
(Clear SPRSi in UIFR3
to 0)
Confirm that
remote-wakeup is
prohibited
Disable SOF marker
function
(Clear SFME in UCTLR
to 0)
Confirm that
remote-wakeup is enabled
Enable USB module
stop mode
(Set MSTPB0
in MSTPCRB to 1)
Set standby enable
flag to 1
Clear standby enable
flag to 0
Wait for USB operating
clock stabilization
Suspend
state confirmed?
(SPRSs in UIFR3 =
1?)
SOF marker
function enabled?
Remote-
wakeup enabled?
(RWUPs in UDRR
= 1)
USB operating
clock stabilization time
has passed?
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
EXIRQx
EXIRQx
No
No
*
5
*
5
*
6
*
3
*
4
*
1
*
4
*
6
*
1
*
1
*
2
Standby enable
flag = 0?
Suspend
state confirmed?
(SPRSs in UIFR3 =
1?)
Suspend
state confirmed?
(SPRSs in UIFR3
= 1?)
Yes
No
IRQ6
Notes: 1. The standby enable flag is a software flag for controlling transition to the standby state. There is no such hardware flag.
2. Interrupts should be masked from when the IRQ6 interrupt is received until the SLEEP instruction is executed. Finally, unmask the interrupts
using the LDC instruction or the like and execute the SLEEP instruction immediately afterward.
3. The remote-wakeup function cannot be used unless it is enabled by the host. Accordingly, the remote-wakeup function cannot be used
unless it is enabled by the host. Accordingly, make sure to check RWUPs in UDRR before using the remote-wakeup function. However, it is
not necessary to confirm that the remote-wakeup function is enabled by the host if the application does not make use of this function.
4. Make this setting only if the SOF marker function will be used.
5. When resuming by means of remote-wakeup the USB operating clock has already stabilized, so this step is not necessary.
6. Return to the main process and wait for the USB operating clock stabilization detection interrupt. When resuming by means of remote-
wakeup the USB operating clock has already stabilized, so this step is not necessary.
Enable IRQ6 interrupt
(Set IRQ6E in IER to 1)
Figure 15.9 Example Flowchart of Suspend and Resume Interrupt Processing