English
Language : 

H8S-2218 Datasheet, PDF (556/750 Pages) Renesas Technology Corp – Renesas 16-Bit Single-Chip Microcomputer H8S Family H8S-2200 Series
Section 14 Universal Serial Bus (USB)
(2) Data Stage (Control-In)
The firmware first analyzes the command data that is sent 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 in-transfer, one packet of data to be sent to the host is written to the FIFO. If
there is more data to be sent, this data is written to the FIFO after the data written first has been
sent to the host (EP0iTS in UIFR0 is set to 1).
The end of the data stage is identified when the host transmits an OUT token and the status
stage is entered.
USB function
Receive IN token
Firmware
From setup stage
1 written
to EP0sRDFN
in UTRG0?
Yes
No
NAK
Valid data
in EP0i FIFO?
Yes
Transmit data to host
ACK
No
NAK
Set EP0i transmit
complete flag
(EP0iTS in UIFR0 = 1)
EXIRQx
Write data to USB endpoint
data register 0i (UEDR0i)
Write 1 to EP0i packet
enable bit
(EP0iPKTE in UTRG0 = 1)
Clear EP0i transmit
complete flag
(EP0iTS in UIFR0 = 0)
Write data to USB endpoint
data register 0i (UEDR0i)
Write 1 to EP0i packet
enable bit
(EP0iPKTE in UTRG0 = 1)
Note:
If the size of the data transmitted by the function is smaller than the data size requested by the host,
the function indicates the end of the data stage by returnning to the host a packet shorter than the
maximum packet size. If the size of the data transmitted by the function is an integral multiple of the
maximum packet size, the function indicates the end of the data stage by transmitting a zero-length
packet.
Figure 14.13 Data Stage Operation (Control-In)
Rev.6.00 Jun. 03, 2008 Page 508 of 698
REJ09B0074-0600