
Functional Description
1692
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Universal Serial Bus (USB) Controller
When the FIFO in the USB becomes available, the DMA controller requests bus mastership and transfer a
packet to the FIFO. With the AUTOSET bit set, the USB automatically sets the TXRDY bit. This process
continues until the entire data block has been transferred to the USB. The DMA controller then interrupts
the processor. If the last packet to be loaded was less than the maximum packet size for the endpoint, the
TXRDY bit is not set for this packet. The processor should therefore respond to the DMA interrupt by
setting the TXRDY bit to allow the last short packet to be sent. If the last packet to be loaded was of the
maximum packet size, then the action to take depends on whether the transfer is under the control of an
application such as the mass storage software on a Windows system that keeps count of the individual
packets sent. If the transfer is not under such control, the processor should still respond to the DMA
interrupt by setting the TXRDY bit in the USB Transmit Control and Status Endpoint n Low
(USBTXCSRLn) register. This has the effect of sending a null packet for the receiving software to interpret
as indicating the end of the transfer.
27.3.7 USB Clock Structure
The USB block receives two clocks. The main peripheral is clocked from the system clock (SYSCLK)
while the serialization and deserialization circuitry requires a fixed 60 MHz clock source. When using the
integrated USB PHY, the 60 MHz clock is constructed by dividing the PLL VCO output by a dedicated
programmable divisor. The divisor is controlled by the USBCC register. When using the ULPI interface,
the 60-MHz clock is selected either from the internal PLL VCO path or the ULPI signal USB0CLK. If the
source is the PLL VCO path, the USB0CLK signal must be an output; otherwise, USB0CLK is an input. To
correctly synchronize with the data between the main block and the serialization and deserialization
circuitry, the main block requires f
SYSCLK
of 30 MHz.
(1)
The CLKDIV bit resides in the USBCC register.
Table 27-4. USB0CLK Direction During ULPI Mode
ULPIEN Bit in
USBPC Register
CSD Bit in USBCC
Register
60 MHz Clock Source
(1)
USB0CLK
Direction
0
X
VCO PLL (1)
Not Used
1
0
VCO PLL (1)
Output
1
1
USBCLK0
Input
27.4 Initialization and Configuration
To initialize the USB controller:
1. To enable the USB controller, the peripheral clock must be enabled through the RCGCUSB register.
2. In addition, the clock to the appropriate GPIO module must be enabled through the RCGCGPIO
register in the System Control module. To find out which GPIO port to enable, see the device-specific
data sheet. Configure the PMCn fields in the GPIOPCTL register to assign the USB signals to the
appropriate pins (see
and the device-specific data sheet).
3. Program the internal clock configuration through the USBCC register.
4. Perform a software reset of the USB using the SRUSB register.
5. Disable the internal clock source if the USB PHY is driving the clock (as is the case when using the
ULPI interface). By setting the CSD bit in the USBCC register, an external USB clock source is
selected.
6. Enable the appropriate PHY (external or internal) by programming the ULPIEN bit in the USBPC
register.