![](http://datasheet.mmic.net.cn/90000/ML66Q525-NTB_datasheet_3507944/ML66Q525-NTB_362.png)
ML66525 Family User’s Manual
Chapter 17 USB Control Function
17 - 5
17.3.5
Data Packet Transmission and Reception Procedure During Bulk Transfer
and Interrupt Transfer Modes
The transfer of data is the major function in all types of transfer modes other than the control
transfer mode. When carrying out transfer of data packets between USB controller and the host,
the following packet communication is carried out via the USB bus for the data transfer of each
packet.
(a) Token packet transfer (IN token or OUT token) from the host to USB controller.
(b) Data packet transfer in the desired direction (from the host to the device or from the device
to the host).
(c) Transfer of handshake packet in a direction opposite to that of the data packet.
When packet transfer is completed normally, an ACK packet is returned in step (c) and the
operation proceeds to the next packet transfer.
USB controller requests CPU to transmit or receive a packet of data. The interrupt cause will be
“packet ready”. The transmit packet ready interrupt is one that requests that the packet of data to
be transmitted be written in the transmit FIFO, and the receive packet ready interrupt is one that
requests CPU to read out the data that has been received and stored in the receive FIFO.
The above procedures of transferring one packet of data are explained below for transmission
and reception separately.
1)
During transmission
CPU writes one packet of data that has to be transmitted in the transmit FIFO of the
corresponding EP in USB controller, and sets to “1” the transmit packet ready bit of the
corresponding EP status register of USB controller. When the host transmits the IN token
packet to USB controller specifying the communication method, etc., USB controller
transmits to the host the data packet stored in the above transmit FIFO. When the host
receives one data packet normally, it returns the ACK packet to USB controller.
Consequently, USB controller resets the transmit packet ready bit, thereby completing the
transfer of one data packet over the USB bus. When the transmit packet ready bit is reset,
USB controller gives a request to CPU in terms of a transmit packet ready interrupt thereby
prompting CPU to write the next packet of data to be transmitted.
2)
During reception
The host sends to USB controller an OUT token followed by a data packet. USB controller
stores the received data packet in the receive FIFO of the corresponding EP. When it is
confirmed that all the data packets have been accumulated and that there is no error, USB
controller returns an ACK packet to the host. At the same time, the receive packet ready bit
of the corresponding EP status register will also be set to “1” and a request is sent to CPU in
terms of an interrupt. Upon receiving this interrupt, CPU reads out the received data from
USB controller and resets the receive packet ready bit.