Datasheet
Section 16 USB Function Module (USB)
R01UH0309EJ0500 Rev. 5.00 Page 1001 of 1408
Sep 24, 2012
H8S/2456, H8S/2456R, H8S/2454 Group
(3) Data Stage (Control-Out)
USB function Application
OUT token reception
Data reception from host
OUT token reception
Set EP0o reception
complete flag.
(IFR1.EP0o TS = 1)
Clear EP0o reception
complete flag.
(IFR1.EP0o TS = 0)
Read data from EP0o
receive data size register
(EPSZ0o).
Write 1 to EP0o read
complete bit.
(TRG0.EP0o RDFN = 1)
Read data from EP0o
data register (EPDR0o).
1 written
to TRG0.EP0s
RDFN?
1 written
to TRG0.EP0o
RDFN?
NAK
NAK
ACK
No
Yes
No
Yes
Interrupt request
Figure 16.13 Data Stage (Control-Out) Operation
The application first analyzes command data from the host in the setup stage, and determines the
subsequent data stage direction. If the result of command data analysis is that the data stage is out-
transfer, the application waits for data from the host, and after data is received (EP0o TS bit in
IFR1 = 1), reads data from the FIFO. Next, the application writes 1 to the EP0o read complete bit,
empties the receive FIFO, and waits for reception of the next data.
The end of the data stage is identified when the host transmits an IN token and the status stage is
entered.