
ML66525 Family User’s Manual
Chapter 17 USB Control Function
17 - 7
17.3.7
Packets and Packet Sizes
USB controller packs the transmit data into packets and unpacks (restores to the original form)
the received data. The packed data that is recognized by the software client is a set of data
consisting of one or more packets, and this is called an I/O request (IRP).
Among the several packets in an IRP, all the packets other than the last packet are transferred
with the maximum packet size. Only the last packet can be transferred as a “short packet”, that is,
a packet whose size is less than the maximum packet size.
Packet
1
I/O Request Packet (IRP)
Maximum packet size
Packet
2
Packet
n-1
Packet
n
1 Packet
m bytes
USB controller has payload registers corresponding to each end point, and it is possible to set the
maximum packet size for each end point in these registers. The maximum packet size should be
within the capacity of the corresponding FIFO, and can be set as follows:
(1)
EP0 Receive packet size can be 32 bytes or less;
(2)
EP0 Transmit packet size can be 32 bytes or less;
(3)
EP1 Transmit/receive packet size can be 64 bytes or less;
(4)
EP2 Transmit/receive packet size can be 64 bytes or less;
(5)
EP3 Transmit/receive packet size can be 32 bytes or less;
(6)
EP4 Transmit/receive packet size can be 64 bytes or less;
(7)
EP5 Transmit/receive packet size can be 64 bytes or less;
On the USB bus, the separation between successive packets is distinguished by appending a
special signal condition called EOP (End of Packet) at the end of each packet. The appending of
EOP during transmission and the detection and removal of EOP during reception are carried out
by USB controller automatically.
(1) At the time of transmission, the packet is deemed to have ended when CPU has completed
writing the required number of bytes of data in the transmit FIFO and has then asserted the
transmit packet ready bit.
(The actual addition of EOP is executed at the time of
transmitting the data over the USB bus after waiting for the IN token from the host.) The
packet will be a short packet if the transmit packet ready bit is asserted after writing data