English
Language : 

LM3S5739 Datasheet, PDF (675/856 Pages) Texas Instruments – Stellaris® LM3S5739 Microcontroller
Stellaris® LM3S5739 Microcontroller
The dedicated control interface can only be used for control transactions to endpoint 0 of Devices.
These control transactions are used during enumeration or other control functions that communicate
using endpoint 0 of Devices. This control endpoint shares the first 64 bytes of the USB controller’s
FIFO RAM for IN and OUT transactions. The remaining IN and OUT interfaces can be configured
to communicate with control, bulk, interrupt, or isochronous Device endpoints.
These USB interfaces can be used to simultaneously schedule as many as three independent OUT
and three independent IN transactions to any endpoints on any Device. The IN and OUT controls
are paired in three sets of registers. However, they can be configured to communicate with different
types of endpoints and different endpoints on Devices. For example, the first pair of endpoint controls
can be split so that the OUT portion is communicating with a Device’s bulk OUT endpoint 1, while
the IN portion is communicating with a Device’s interrupt IN endpoint 2.
Before accessing any Device, whether for point-to-point communications or for communications via
a hub, the relevant USB Receive Functional Address Endpoint n (USBRXFUNCADDRn) or USB
Transmit Functional Address Endpoint n (USBTXFUNCADDRn) registers must be set for each
receive or transmit endpoint to record the address of the Device being accessed.
The USB controller also supports connections to Devices through a USB hub by providing a register
that specifies the hub address and port of each USB transfer. The FIFO address and size are
customizable and can be specified for each USB IN and OUT transfer. Customization includes
allowing one FIFO per transaction, sharing a FIFO across transactions, and allowing for
double-buffered FIFOs.
17.3.2.2
IN Transactions as a Host
IN transactions are handled in a similar manner to the way in which OUT transactions are handled
when the USB controller is in Device mode except that the transaction first must be initiated by
setting the REQPKT bit in the USBCSRL0 register, indicating to the transaction scheduler that there
is an active transaction on this endpoint. The transaction scheduler then sends an IN token to the
target Device. When the packet is received and placed in the receive FIFO, the RXRDY bit in the
USBCSRL0 register is set, and the appropriate receive endpoint interrupt is signaled to indicate
that a packet can now be unloaded from the FIFO.
When the packet has been unloaded, RXRDY must be cleared. The AUTOCL bit in the USBRXCSRHn
register can be used to have RXRDY automatically cleared when a maximum-sized packet has been
unloaded from the FIFO. The AUTORQ bit in USBRXCSRHn causes the REQPKT bit to be automatically
set when the RXRDY bit is cleared. The AUTOCL and AUTORQ bits can be used with µDMA accesses
to perform complete bulk transfers without main processor intervention. When the RXRDY bit is
cleared, the controller sends an acknowledge to the Device. When there is a known number of
packets to be transferred, the USB Request Packet Count in Block Transfer Endpoint n
(USBRQPKTCOUNTn) register associated with the endpoint should be configured to the number
of packets to be transferred. The USB controller decrements the value in the USBRQPKTCOUNTn
register following each request. When the USBRQPKTCOUNTn value decrements to 0, the AUTORQ
bit is cleared to prevent any further transactions being attempted. For cases where the size of the
transfer is unknown, USBRQPKTCOUNTn should be cleared. AUTORQ then remains set until cleared
by the reception of a short packet (that is, less than the MAXLOAD value in the USBRXMAXPn
register) such as may occur at the end of a bulk transfer.
If the Device responds to a bulk or interrupt IN token with a NAK, the USB Host controller keeps
retrying the transaction until any NAK Limit that has been set has been reached. If the target Device
responds with a STALL, however, the USB Host controller does not retry the transaction but sets
the STALLED bit in the USBCSRL0 register. If the target Device does not respond to the IN token
within the required time, or the packet contained a CRC or bit-stuff error, the USB Host controller
November 17, 2011
675
Texas Instruments-Production Data