Universal Serial Bus (USB)
MCF5272 ColdFire Integrated Microprocessor User’s Manual, Rev. 3
12-32
Freescale Semiconductor
12.4.3
FIFO Configuration
The USB module allows a very flexible FIFO configuration. The FIFO configuration is very application
dependent. The FIFO configuration depends on the current configuration number, alternate setting for each
interface, and each endpoint’s type and packet size. The USB module contains two separate 512-byte FIFO
spaces: one for IN and one for OUT endpoints. The following guidelines must be adhered to when
configuring the FIFO’s:
The MAX_PACKET field in the EPnCFG registers must match the wMaxPacketSize field in the
corresponding endpoint descriptor. An incorrect setting causes USB errors and unexpected
interrupts.
EPnCFG[FIFO_SIZE] must be a power of 2 and must be at least two packets for non-isochronous
endpoints.
The FIFO_ADDR field in the EPnCFG registers must be aligned to a boundary defined by the
FIFO_SIZE field. For example, a FIFO with a size equal to 64 bytes can have a starting address of
0, 64, 128, 192, 256, etc.
The FIFO space for an endpoint defined by FIFO_SIZE and FIFO_ADDR must not overlap with
the FIFO space for any other endpoint with the same direction.
An example FIFO configuration with a variety of endpoint types and packet sizes is shown in
Table 12-20.12.4.4
Data Flow
The handling of the data flow to and from each endpoint can be divided between isochronous and
non-isochronous endpoints. Isochronous endpoints are designed to transfer streaming data which is
continuous and real-time in creation, delivery, and consumption. The timely delivery of isochronous data
is ensured at the expense of potential transient losses in the data stream. In other words, any error in
electrical transmission in not corrected by hardware mechanisms such as retries. An example of streaming
data is voice.
The other endpoint types transfer message based, or bursted data where integrity of the data is more
important than timely delivery.
Table 12-20. Example FIFO Setup
Endpoint
Number
Endpoint
Direction
Endpoint Type
Max Packet Size
FIFO Size
FIFO Starting
Address
EPnCFG Value
0
IN
Control
8
32
480
0x020101C0
0
OUT
Control
8
32
384
0x02010180
1
IN
Interrupt
17
64
384
0x04420180
2
IN
Bulk
64
128
256
0x10040100
3
OUT
Bulk
32
128
256
0x08040100
4
IN
Isochronous
5
32
448
0x014101C0
5
OUT
Isochronous
5
32
416
0x014101A0
6
IN
Isochronous
300
256
0
0x4B080000
7
OUT
Isochronous
300
256
0
0x4B080000