Datasheet

Table Of Contents
Section 15 Universal Serial Bus Interface (USB)
Page 560 of 846 REJ09B0140-0900 Rev. 9.00
Sep 16, 2010
H8S/2215 Group
(3) Data Stage (Control-Out)
The firmware 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 (EP0oTS of UIFR0
is set to 1), reads data from the FIFO. Next, the firmware 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.
USB function Firmware
Receive OUT token
Receive data from host
Receive OUT token
Set EP0o receive
complete flag
(EP0oTS in UIFR0 = 1)
Clear EP0o receive
complete flag
(EP0oTS in UIFR0 = 0)
Read data from USB endpoint
receive data size register 0o
(UESZ0o)
Write 1 to EP0o read
complete bit
(EP0oRDFN in UTRG0 = 1)
Read data from USB endpoint
data register 0o (UEDR0o)
1 written
to EP0sRDFN in
UTRG0?
1 written
to EP0oRDFN in
UTRG0?
NAK
NAK
ACK
No
Yes
No
Yes
EXIRQx
Figure 15.15 Data Stage Operation (Control-Out)