
UM10375
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2011. All rights reserved.
User manual
Rev. 3 — 14 June 2011
164 of 368
NXP Semiconductors
UM10375
Chapter 10: LPC13xx USB device controller
For non-isochronous endpoints when a full data packet is received without any errors, the
endpoint generates a request for data transfer from its FIFO by generating an interrupt to
the system.
Isochronous endpoint will have one packet of data to be transferred in every frame. This
requires the data transfer has to be synchronized to the USB frame rather than packet
arrival. The 1 KHz free running clock re synchronized on the incoming SoF tokens will
generate an interrupt every millisecond.
The data transfer follows the little endian format. The first byte received from the USB bus
will be available in the LS byte of the receive data register.
10.13.2 Data flow from the Device to the Host
For data transfer from an endpoint to the host, the host will send an IN token to that
endpoint. If the FIFO corresponding to the endpoint is empty, the device will return a NAK
and will generate an interrupt (assuming the interrupt on NAK is enabled). On this
interrupt the processor fills a packet of data in the endpoint FIFO. The next IN token that
comes--after filling this packet--will transfer this packet to the host.
The data transfer follows the little endian format. The first byte sent on the USB bus will be
the LS byte of the transmit data register.
Remark:
USB is a host controlled protocol, i.e., irrespective of whether the data transfer is
from the host to the device or from the device to the host, the transfer sequence is always
initiated by the host. During data transfer from the device to the host, the host sends an IN
token to the device, following which the device responds with the data.
10.13.3 Interrupt based transfer
Interrupt based data transfer is done through the interrupt issued from the USB core to the
processor.
Reception of a valid (error-free) data packet in any of the OUT non-isochronous endpoint
buffer generates an interrupt. Upon receiving the interrupt, the software can read the data
using receive length and data registers. When there is no empty buffer (for a given
non-isochronous OUT endpoint), any data arrival generates an interrupt only if Interrupt
On NAK feature for that endpoint type is enabled and existing interrupt is cleared.
Similarly, when a packet is successfully transferred to the host from any IN
non-isochronous endpoint buffer, an interrupt is generated. When there is no data
available in any of the buffers (for a given non-isochronous IN endpoint), a data request
generates an interrupt only if Interrupt On NAK feature for that endpoint type is enabled
and existing interrupt is cleared. Upon receiving the interrupt, the software can load any
data to be sent using transmit length and data registers.
10.13.4 Isochronous transfer
Isochronous endpoints are double-buffered and the buffer toggling will happen only on
frame boundaries i.e., at every 1 ms. ‘Clear Buffer’ and ‘Validate Buffer’ do not cause the
buffer to toggle.