MCF548x Reference Manual, Rev. 3
29-48 Freescale Semiconductor
At power-up time, the USB module contains no configuration information. The USB module does not
know how many endpoints it has available or how to find the descriptors. Initialization for the device
consists of downloading this information to the appropriate memories and configuring the datapath to
match the intended application. The following steps are involved in the initialization process:
1. Perform a hard reset or a USB reset (set USBCR[USBRST]).
2. Download USB descriptors to the descriptor RAM via the DRAMCR and DRAMDR.
3. Program the USB interrupt mask register (USBIMR) to enable interrupts not associated with a
particular endpoint. Make sure to unmask the RSTSTOP bit.
4. Program the FIFO sizes (EPnFRCFGR) and configure the FIFO RAM according to the
application needs (USBCR[RAMSPLIT] bit).
5. Program the FIFO controller registers (EPnFCR, EPnFAR) for each endpoint, program frame
mode, shadow mode, granularity, alarm level, frame size, etc. (EPnFCR). Normally, all endpoints
should be programmed with both frame mode and shadow mode enabled.
6. Program each endpoint's control (EPnSTAT) and interrupt mask (EPnIMR) registers to support
the intended data transfer modes.
7. Wait for the RSTSTOP interrupt to indicate that reset signalling has completed and the device is
in the DEFAULT state.
8. Program the type (EP0ACR) and maximum packet size (EP0MPSR) for the default control
endpoint.
9. Enable the default control endpoint (EP0OUTSR[ACTIVE]).
10. Program the type (EPn[OUT/IN]ACR) and maximum packet size (EPn[OUT/IN]MPSR) for each
endpoint that will be used in addition to the default control endpoint.
11. Enable each endpoint (EPn[OUT/IN]SR[ACTIVE]) that will be used in addition to the default
control endpoint. Note that module initialization is a time critical process. The USB host will wait
about 100 ms after power-on or a connection event to begin enumerating devices on the bus. This
device must have all of the configuration information available when the host requests it.
Once the device has been enumerated, the USB host will select a specific configuration and set of
interfaces on the device. Software on the device must beware of USB configuration changes requests in
order to maintain proper communication with the USB host. The software retains sole responsibility for
knowing which configuration and alternate interface are current at any given time.

29.4.1.1 USB Descriptor Download

The USB descriptors are standard data structures which are used by the USB host to allocate bandwidth
and to determine how many and what kind of endpoints are available on the device. While this data is
stored in the descriptor RAM, it is not directly used by the USB 2.0 device controller. The data gets
returned to the USB host during a GET_DESCRIPTOR request. The USB host picks a specific
configuration and alternate interface, and then instructs the device which to enable. The USB descriptor
formats are defined in Chapter 9 of the USB Specification, Revision 2.0. Software programs are available
from various sources to assist the integrator in creating the descriptor tables.
Software is responsible for FIFO management and endpoint reconfiguration each time the USB host
requests a configuration change via the SET_CONFIGURATION request.