Functional Description
1687
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Universal Serial Bus (USB) Controller
The DMA request lines are individually enabled through the DMAEN bit in the appropriate USB Transmit
Control and Status Endpoint n High (USBTXCSRHn) register or USB Receive Control and Status
Endpoint n High (USBRXCSRHn) register and operate in two request modes, referred to as DMA Request
Mode 0 and DMA Request Mode 1.
When operating in DMA Mode 0, the DMA controller can be only programmed to load and unload one
packet, so processor intervention is required for each packet transferred over the USB. This mode can be
used with any endpoint, whether it uses Control, Bulk, Isochronous, or Interrupt transactions (that is,
including Endpoint 0).
When operating in DMA Mode 1, the DMA controller can be programmed to load and unload a complete
bulk transfer (which can be many packets). Once set up, the DMA controller loads and unloads all packets
of the transfer, interrupting the processor only when the transfer has completed. DMA Mode 1 can only be
used with endpoints that use Bulk transactions.
Each channel can be independently programmed for the selected operating mode. The choice of
operating mode must be made through the DMAMOD bit in the USBTXCSRHn and the USBRXCSRHn
register. For Rx endpoints operating in Request Mode 0, the DMA request line goes high when a data
packet is available in the endpoint FIFO and normally goes low at the end of the cycle in which the 8th
from last byte starts to be processed (which happens two transfers minus one clock cycle in advance of
the transfer containing this byte). The request line also goes low if the CPU clears the RXRDY bit in the
USB Receive Control and Status Endpoint n Low (USBRXCSRLn) register. The behavior of the DMA
request lines for Rx endpoints in Request Mode 1 is similar except the request line only goes high when
the packet received is of the maximum packet size (as set in the USB Maximum Receive Data Endpoint n
(USBRXMAXPn) register). If the packet received is of some other size, the DMA request line stays low.
Note, however, that if the Request Mode is switched from Request Mode 1 to Request Mode 0, the
request line is asserted if there is a packet in the FIFO in order to allow this prereceived packet to be
downloaded.
For Tx endpoints operating in either Request Mode 0 or Request Mode 1, the DMA request line goes high
when the endpoint FIFO is able to accept a data packet. It normally goes low one clock cycle after the 8th
from last of MAXLOAD bytes in the USBTXMAXPn register have been loaded into the FIFO. The request
line also goes low if the CPU sets the TXRDY bit of the USB Transmit Control and Status Endpoint n Low
(USBTXCSRLn) register.
NOTE:
When operating in host mode, if either the STALLED bit or the ERROR bit in the
USBTXCSRLn register becomes set following three failed attempts to transmit a packet, the
DMA request line is disabled until the STALLED and ERROR bit has been cleared.
The mode selected also affects the generation of endpoint interrupts. In DMA Request Mode 0, no
interrupt is generated when packets are received but the appropriate Endpoint interrupt is generated to
prompt the loading of all packets. In DMA Request Mode 1, the Endpoint interrupt is suppressed except
following the receipt of a short packet (that is, one of less than MAXLOAD bytes).
and
summarize the conditions under which TX and RX Endpoint interrupts are generated.
Table 27-2. Endpoint Interrupt Associated With USBRXCSRLn.RXRDY = 1
USBRXCSRHn.DMAEN
USBRXCSRHn.DMAMOD
Interrupt Generated?
0
X
Yes
1
0
No
1
1
Only if short packet
Table 27-3. Endpoint Interrupt Associated With USBTXCSRLn.TXRDY = 1
USBTXCSRHn.DMAEN
USBTXCSRHn.DMAMOD
Interrupt Generated?
0
X
Yes
1
0
Yes
1
1
No