Architecture
1644
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Serial Bus 2.0 (USB) Controller
34.2.7.2.2.2 Host Mode: Bulk OUT Transactions
A Bulk OUT transaction may be used to transfer non-periodic data from the host to the USB peripheral.
Following optional features are available for use with a Tx endpoint used in Host mode to transmit this
data:
•
Double packet buffering: When enabled, up to two packets can be stored in the FIFO awaiting
transmission to the peripheral device. Double packet buffering is enabled by setting the DPB bit of
TXFIFOSZ register (bit 4).
•
DMA: If DMA is enabled for the endpoint, a DMA request will be generated whenever the endpoint is
able to accept another packet in its FIFO. This feature can be used to allow the DMA controller to load
packets into the FIFO without processor intervention.
When DMA is enabled and DMAMODE bit in HOST_TXCSR register is set, an endpoint interrupt will
not be generated for completion of packet reception. An endpoint interrupt will be generated only in the
error conditions.
34.2.7.2.2.2.1 Setup
Before initiating any bulk OUT transactions:
•
The target function address needs to be set in the TXFUNCADDR register for the selected controller
endpoint. (TXFUNCADDR register is available for all endpoints from EP0 to EP4.)
•
The HOST_TXTYPE register for the endpoint that is to be used needs to be programmed as:
–
Operating speed in the SPEED bit field (bits 7 and 6).
–
Set 10b in the PROT field for bulk transfer.
–
Endpoint Number of the target device in TENDPN field. This is the endpoint number contained in
the OUT(Tx) endpoint descriptor returned by the target device during enumeration.
•
The TXMAXP register for the controller endpoint must be written with the maximum packet size (in
bytes) for the transfer. This value should be the same as the wMaxPacketSize field of the Standard
Endpoint Descriptor for the target endpoint.
•
The HOST_TXINTERVAL register needs to be written with the required value for the NAK limit (2-215
frames/microframes), or set to zero if the NAK timeout feature is not required.
•
The relevant interrupt enable bit in the INTRTXE register should be set (if an interrupt is required for
this endpoint).
•
The following bits of HOST_TXCSR register should be set as:
–
Set the MODE bit (bit 13) to 1 to ensure the FIFO is enabled (only necessary if the FIFO is shared
with an Rx endpoint).
–
Set the DMAEN bit (bit 12) to 1 if a DMA request is required for this endpoint.
–
Clear the FRCDATATOG bit (bit 11) to 0 to allow normal data toggle operations.
–
Set the DMAMODE bit (bit 10) to 1 when DMA is enabled.
When the endpoint is first configured, the endpoint data toggle should be cleared to 0 either by using the
DATATOGWREN bit and DATATOG bit of HOST_TXCSR (bit 9 and bit 8) to toggle the current setting or
by setting the CLRDATATOG bit of HOST_TXCSR (bit 6). This will ensure that the data toggle (which is
handled automatically by the controller) starts in the correct state. Also, if there are any data packets in
the FIFO (indicated by the FIFONOTEMPTY bit of HOST_TXCSR register (bit 1) being set), they should
be flushed by setting the FLUSHFIFO bit (bit 3 of HOST_TXCSR).
NOTE:
It may be necessary to set this bit twice in succession if double buffering is enabled.