![Texas Instruments AM1808 Technical Reference Manual Download Page 1625](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581625.webp)
Architecture
1625
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Serial Bus 2.0 (USB) Controller
34.2.7.1.2
Bulk Transactions
34.2.7.1.2.1
Bulk In Transactions
A Bulk IN transaction is used to transfer non-periodic data from the USB peripheral device to the host.
The following optional features are available for use with a Tx endpoint used in peripheral mode for Bulk
IN transactions:
•
Double packet buffering: When enabled, up to two packets can be stored in the FIFO awaiting
transmission to the host. 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 allows the DMA controller to load packets into
the FIFO without processor intervention.
34.2.7.1.2.1.1 Setup
In configuring a TX endpoint for bulk transactions, the TXMAXP register must be written with the
maximum packet size (in bytes) for the endpoint. This value should be the same as the wMaxPacketSize
field of the Standard Endpoint Descriptor for the endpoint and the PERI_TXCSR register should be set as
shown in
when using DMA:
Table 34-4. PERI_TXCSR Register Bit Configuration for Bulk IN Transactions
Bit Position
Bit Field Name
Configuration
Bit 14
ISO
Cleared to 0 for bulk mode operation.
Bit 13
MODE
Set to 1 to make sure the FIFO is enabled (only necessary if the FIFO is shared with an RX
endpoint).
Bit 12
DMAEN
Set to 1 if DMA requests must be enabled.
Bit 11
FRCDATATOG
Cleared to 0 to allow normal data toggle operations.
Bit 10
DMAMODE
Set to 1 when DMA is enabled.
When the endpoint is first configured (following a SET_CONFIGURATION or SET_INTERFACE command
on Endpoint 0), the lower byte of PERI_TXCSR should be written to set the CLRDATATOG bit (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 (bit 1 of
PERI_TXCSR) being set, they should be flushed by setting the FLUSHFIFO bit (bit 3 of PERI_TXCSR).
NOTE:
It may be necessary to set this bit twice in succession if double buffering is enabled.
34.2.7.1.2.1.2 Operation
When data is to be transferred over a Bulk IN pipe, a data packet needs to be loaded into the FIFO and
the PERI_TXCSR register written to set the TXPKTRDY bit (bit 0). When the packet has been sent, the
TXPKTRDY bit will be cleared by the USB controller and an interrupt generated so that the next packet
can be loaded into the FIFO. If double packet buffering is enabled, then after the first packet has been
loaded and the TXPKTRDY bit set, the TXPKTRDY bit will immediately be cleared by the USB controller
and an interrupt generated so that a second packet can be loaded into the FIFO. The software should
operate in the same way, loading a packet when it receives an interrupt, regardless of whether double
packet buffering is enabled or not.
In the general case, the packet size must not exceed the size specified by the lower 11 bits of the
TXMAXP register. This part of the register defines the payload (packet size) for transfers over the USB
and is required by the USB Specification to be either 8, 16, 32, 64 (Full-Speed or High-Speed) or
512 bytes (High-Speed only).