Datasheet
Section 16 USB Function Module (USB)
R01UH0309EJ0500 Rev. 5.00 Page 1003 of 1408
Sep 24, 2012
H8S/2456, H8S/2456R, H8S/2454 Group
(5) Status Stage (Control-Out)
USB function Application
IN token reception
0-byte transmission to host
End of control transfer
Set EP0i transmission
complete flag.
(IFR1.EP0i TS = 1)
Clear EP0i transfer
request flag.
(IFR1.EP0i TR = 0)
Write 1 to EP0i packet
enable bit.
(TRG0.EP0i PKTE = 1)
Clear EP0i transmission
complete flag.
(IFR1.EP0i TS = 0)
End of control transfer
Valid data
in EP0i FIFO?
ACK
Yes
No
NAK
Interrupt request
Interrupt request
Figure 16.15 Status Stage (Control-Out) Operation
The control-out status stage starts with an IN token from the host. When an IN-token is received at
the start of the status stage, there is not yet any data in the EP0i FIFO, and so an EP0i transfer
request interrupt is generated. The application recognizes from this interrupt that the status stage
has started. Next, in order to transmit 0-byte data to the host, 1 is written to the EP0i packet enable
bit but no data is written to the EP0i FIFO. As a result, the next IN token causes 0-byte data to be
transmitted to the host, and control transfer ends.
After the application has finished all processing relating to the data stage, 1 should be written to
the EP0i packet enable bit.