Datasheet

Section 16 USB Function Module (USB)
R01UH0309EJ0500 Rev. 5.00 Page 999 of 1408
Sep 24, 2012
H8S/2456, H8S/2456R, H8S/2454 Group
(1) Setup Stage
USB function
Application
SETUP token reception
Receive 8-byte command
data in EP0s
To data stage
Set setup command
reception complete flag.
(IFR1.SETUP TS = 1)
Automatic
processing by
this module
Clear SETUP TS flag.
(IFR1.SETUP TS = 0)
Clear EP0i FIFO. (FCLR0.EP0iCLR = 1)
Clear EP0o FIFO..(FCLR0.EP0oCLR = 1)
Read 8-byte data from EP0s.
Decode command data.
Determine data stage direction.*
1
Write 1 to EP0s read complete bit.
(TRG0.EP0s RDFN = 1)
To control-in
data stage
To control-out
data stage
Command
to be processed by
application?
Interrupt request
Yes
No
Notes: 1. In the setup stage, the application analyzes command data from the host requiring processing by
the application, and determines the subsequent processing (for example, data stage direction, etc.).
2. When the transfer direction is control-out, the EP0i transfer request interrupt required in the status
stage should be enabled here. When the transfer direction is control-in, this interrupt is not required
and should be disabled.
*
2
Figure 16.11 Setup Stage Operation