Rev.2.00 Oct 16, 2006 page 176 of 354
REJ09B0340-0200
M30245 Group
2. USB function
(3) Control Transfer: Endpoint 0 Transmit
The endpoint 0 transmits the packet data to the host CPU in the data stage by the control read after
completion of receive request analysis process in the setup stage.
Write one packet data to be transmitted in IN FIFO. Every time that one-byte data is written in IN FIFO,
the internal write pointer is automatically incremented by “2” in word access and by “1” in byte access.
The contents of internal write pointer cannot be read. When the data write in IN FIFO is completed, set
IN_BUF_RDY flag to “1” by setting “1” to SET_IN_BUF_RDY bit. When an empty packet (with 0 data
length) is transmitted, data is not written in IN FIFO and SET_IN_BUF_RDY bit is set to “1”.
At this time, one packet transmission is prepared and is transmitted by the USB function control unit in
the next IN token.
The IN_BUF_RDY flag is automatically set to “0”, when one packet data transmission is completed to
the host CPU (or on receiving ACK) or when the SETUP_END flag is set to “1”. After writing the last
data packet in IN FIFO, set SET_IN_BUF_RDY bit to “1” and, simultaneously set SET_DATA_END bit
to “1”. Both the IN_BUF_RDY flag and DATA_END flag are set to “1”. When the DATA_END flag
becomes “1” after completion of transmission of the last data packet, the USB function control unit
proceeds to the status phase processing.
When the status phase is completed, the DATA_END flag is cleared to “0”.
Manage the stage of control transfer by software.
●
Example of one packet data transmit procedure
1: Check that the packet data does not exist in IN FIFO (the IN_BUF_RDY flag is “0”) before writing
the data of the 2nd packet and after of data stage.
2: The data is written in IN FIFO based on the amount specified on the SETUP stage.
When an empty packet (with 0 data length) is transmitted, the data is not written in IN FIFO.
The subsequent stage and operation are determined.
3: With SET_IN_BUF_RDY bit being set to “1”, one packet transmission is prepared, and the next
stage control is managed.
• For shifting into the status stage even if the next data to be transmitted does not exist, simulta-
neously set SET_IN_BUF_RDY bit and SET_DATA_END bit.
• When the next empty packet is transmitted, set SET_IN_BUF_RDY bit to “1” and continue
transmitting processing.
Содержание M16C FAMILY
Страница 12: ...Chapter 1 Hardware...
Страница 13: ...See M30245 group datasheet...
Страница 14: ...Chapter 2 Peripheral Functions Usage...
Страница 303: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 304: ...Chapter 3 Examples of Peripheral Functions Applications...
Страница 340: ...Chapter 4 External Buses...
Страница 361: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 362: ...Chapter 5 Standard Characteristics...
Страница 369: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M30245 Group REJ09B0340 0200 User s Manual...