Datasheet

Section 14 Universal Serial Bus (USB)
Rev.7.00 Dec. 24, 2008 Page 511 of 698
REJ09B0074-0700
(5) Status Stage (Control-Out)
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 firmware 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 firmware has finished all processing relating to the data stage, 1 should be written to
the EP0i packet enable bit.
USB function Firmware
Receive IN token
Transfer 0-byte data to host
End of control transfer
Set EP0i transmit
complete flag
(EP0iTS in UIFR0 = 1)
Clear EP0i transfer
request flag
(EP0iTR in UIFR0 = 0)
Write 1 to EP0i packet
enable bit
(EP0iPKTE in UTRG0 = 1)
Write 0 to EP0i transfer
request interrupt enable bit
(EP0iTRE in UIER0 = 0)
Clear EP0i transmit
complete flag
(EP0iTS in UIFR0 = 0)
End of control transfer
Valid data
in EP0i FIFO?
ACK
Yes
No
NAK
EXIRQx
EXIRQx
Figure 14.16 Status Stage Operation (Control-Out)