30.01.2015 Views

UM10211 - Standard ICs

UM10211 - Standard ICs

UM10211 - Standard ICs

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NXP Semiconductors<br />

<strong>UM10211</strong><br />

Chapter 13: LPC2300 USB device<br />

data to be sent<br />

by host driver<br />

data in packets<br />

as seen on USB<br />

data to be stored in USB<br />

RAM by DMA engine<br />

160 bytes<br />

64 bytes<br />

160 bytes<br />

DMA_buffer_start_addr<br />

of DD1<br />

64 bytes<br />

32 bytes<br />

100 bytes<br />

32 bytes<br />

64 bytes<br />

100 bytes<br />

DMA_buffer_start_addr<br />

of DD2<br />

4 bytes<br />

Fig 54. Data transfer in ATLE mode<br />

Figure 13–54 shows a typical OUT USB transfer in ATLE mode, where the host<br />

concatenates two USB transfers of 160 bytes and 100 bytes, respectively. Given a<br />

MaxPacketSize of 64, the device hardware interprets this USB transfer as four packets of<br />

64 bytes and a short packet of 4 bytes. The third and fourth packets are concatenated.<br />

Note that in Normal mode, the USB transfer would be interpreted as packets of 64, 64, 32,<br />

and 64 and 36 bytes.<br />

It is now the responsibility of the DMA engine to separate these two USB transfers and put<br />

them in the memory locations in the DMA_buffer_start_addr field of DMA Descriptor 1<br />

(DD1) and DMA Descriptor 2 (DD2).<br />

Hardware reads the two-byte-wide DMA_buffer_length at the offset (from the start of the<br />

USB transfer) specified by Message_length_position from the incoming data packets and<br />

writes it in the DMA_buffer_length field of the DD. To ensure that both bytes of the<br />

DMA_buffer_length are extracted in the event they are split between two packets, the<br />

flags LS_byte_extracted and MS_byte_extracted are set by hardware after the respective<br />

byte is extracted. After the extraction of the MS byte, the DMA transfer continues as in the<br />

normal mode.<br />

The flags LS_byte_extracted and MS_byte_extracted are set to 0 by software when<br />

preparing a new DD. Therefore, once a DD is retired, the transfer length is extracted again<br />

for the next DD.<br />

If DD1 is retired during the transfer of a concatenated packet (such as the third packet in<br />

Figure 13–54), and DD2 is not programmed (Next_DD_valid field of DD1 is 0), then DD1<br />

is retired with DD_status set to the DataOverrun status code. This is treated as an error<br />

condition and the corresponding EPxx_DMA_ENABLE bit of USBEpDMASt is cleared by<br />

hardware.<br />

<strong>UM10211</strong>_1<br />

© NXP B.V. 2007. All rights reserved.<br />

User manual Rev. 01 — 27 March 2007 317 of 613

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!