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 retries the transaction. If after three attempts the target device has
still not responded, the USB Host controller clears the REQPKT bit and sets the ERROR bit in the USBCSRL0
register.
17.2.2.3 OUT Transactions as a Host
OUT transactions are handled in a similar manner to the way in which IN transactions are handled when the
USB controller is in device mode. The TXRDY bit in the USBTXCSRLn register must be set as each packet is
loaded into the transmit FIFO. Again, setting the AUTOSET bit in the USBTXCSRHn register automatically sets
TXRDY when a maximum-sized packet has been loaded into the FIFO.
If the target device responds to the OUT token with a NAK, the USB Host controller keeps retrying the
transaction until the NAK Limit that has been set has been reached. However, if the target device responds
with a STALL, the USB controller does not retry the transaction but interrupts the main processor by setting the
STALLED bit in the USBTXCSRLn register. If the target device does not respond to the OUT token within the
required time, or the packet contained a CRC or bit-stuff error, the USB Host controller retries the transaction. If
after three attempts the target device has still not responded, the USB controller flushes the FIFO and sets the
ERROR bit in the USBTXCSRLn register.
17.2.2.4 Transaction Scheduling
Scheduling of transactions is handled automatically by the USB Host controller. The Host controller allows
configuration of the endpoint communication scheduling based on the type of endpoint transaction. Interrupt
transactions can be scheduled to occur in the range of every frame to every 255 frames in 1 frame increments.
Bulk endpoints do not allow scheduling parameters, but do allow for a NAK timeout in the event an endpoint on a
device is not responding.
The USB controller maintains a frame counter. If the target device is a full-speed device, the USB controller
automatically sends an SOF packet at the start of each frame and increments the frame counter. If the target
device is a low-speed device, a K state is transmitted on the bus to act as a keep-alive to stop the low-speed
device from going into SUSPEND mode.
After the SOF packet has been transmitted, the USB Host controller cycles through all the configured endpoints
looking for active transactions. An active transaction is defined as a receive endpoint for which the REQPKT bit
is set or a transmit endpoint for which the TXRDY bit and/or the FIFONE bit is set.
An interrupt transaction is started if the transaction is found on the first scheduler cycle of a frame and if
the interval counter for that endpoint has counted down to zero. As a result, only one interrupt transaction
occurs per endpoint every n frames, where n is the interval set via the USB Host Transmit Interval Endpoint
n (USBTXINTERVAL[
n
]) or USB Host Receive Interval Endpoint n (USBRXINTERVAL[
n
]) register for that
endpoint.
An active bulk transaction starts immediately, provided sufficient time is left in the frame to complete the
transaction before the next SOF packet is due. If the transaction must be retried (for example, because a NAK
was received or the target device did not respond), then the transaction is not retried until the transaction
scheduler has first checked all the other endpoints for active transactions. This process ensures that an endpoint
that is sending a lot of NAKs does not block other transactions on the bus. The controller also allows the user to
specify a limit to the length of time for NAKs to be received from a target device before the endpoint times out.
17.2.2.5 USB Hubs
The following setup requirements apply to the USB Host controller only if it is used with a USB hub. When
a full- or low-speed device is connected to the USB controller via a USB 2.0 hub, details of the hub
address and the hub port also must be recorded in the corresponding USB Receive Hub Address Endpoint
Universal Serial Bus (USB) Controller
1064
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......