UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
244 of 362
NXP Semiconductors
UM10208
Chapter 17: LPC2800 USB Device
2. Write the Endpoint Interrupt Enable Register (
) to enable endpoint
interrupts.
3. For each endpoint, write the Endpoint Index Register to select it, then write its
Endpoint Control Register (
), Endpoint Type Register
(
), and Endpoint MaxPacketSize Register (
4. Assuming that the USB DMA channels will be used, write the four Flow Control Port
Registers (
), the DMA Control Register (
), and the
DMA Interrupt Enable Register (
).
9.5 Receiving data from an OUT (RX) endpoint in Interrupt/slave mode
When an endpoint interrupt occurs when a packet arrives at an OUT endpoint, software/
firmware should do the following:
1. Write the Endpoint Index Register to select the OUT Endpoint.
2. Read the Data Count Register (
) to determine how many bytes are
available.
3. Read the Data Port Registers (
) the appropriate number of times to
read the packet data.
9.6 Sending data to an IN (TX) endpoint in Interrupt/slave mode
Suppose that an endpoint interrupt occurs when an IN token is NAKed. Software/
firmware should do the following:
1. Write the Endpoint Index Register to select the IN Endpoint.
2. Write the Data Count Register (
) with the number of bytes in the
packet.
3. Write the Data Port Registers (
) the appropriate number of times to
send the packet data.
Another interrupt can be arranged when the packet has been sent to the host.
9.7 Receiving data from an OUT (RX) endpoint in DMA mode
Software/firmware should program the DMA channel as follows:
1. If necessary, find a free DMA channel (see the last paragraph of
2. Write the channel’s Source (
Address Registers.
3. Write the channel’s Throttle Register (
) for an OUT (RX) transfer.
4. Write the channel’s Count Register (
) with the expected number of
bytes.
5. Write the DMA Interrupt Enable Register (
) to enable interrupt from
the channel.
6. Write the channel’s Control Register (
) appropriately for an OUT (RX)
transfer from the selected endpoint number, with a non-zero CHEN field, and
presumably to request an interrupt on packet completion or error.
An interrupt will occur when the DMA channel has read a packet into memory.