Hi,
> excuse my questions which are more USB related than to
> LPC2148: I want to transfer some data from LPC2148 to PC. My
> data is a big amount of data. "Jitter" is no problem. In
> reverse direction (PC -> LPC2148) there is almost no
> throughput required. There are various endpoints to choose
> from in LPC2148. Which one should i choose for my application ?
>
> Here are my current ideas:
>
> I can't deal with lost packets, so i can't use isochronous
> packets. Is this right ?
Isochronous packets are not guaranteed to be error free or even to make
it to the device.
> Control and interrupt endpoints are slow, correct ?
You won't be transferring huge amounts of data down a control endpoint.
Interrupt endpoints are just that and the retry happens in the next
period.
> But for big amount of data, it looks like the isochronous
> data packets are better, because the chunk itself can be 1023
> bytes instead of only 64 bytes.
It's true that iso transfers are up to 1023 bytes--however, there is no
retry on error. Isochronous endpoints are usually used for audio where
dropping a packet or a bad packet may not be the end of the world. If
you deal with iso packets, you'll probably want to know about USB frames
too.
> Or are the small bulk packets
> transferred more often than the big iso packet, so throughput
> is the same ?
You have to understand that IN transfers (device -> PC) are POLLED.
Your USB device can't send anything to the host unless it's been asked
to, and the token sent to ask the device whether it has anything to send
to the host comes around once in a while--defined by the device
descriptors. Hence, the descriptors you use will define the frequency
of the IN transactions. You'll need to read up on this.
> Can i use multiple bulk endpoints (e.g. i use physical 5, 11,
> 17, 23, 29 and 31) at the same time to increase throughput or
> is sum of throughput the same as using the endpoint
> sequential ?
Good question. The answer is that if your device has double buffering
for USB packets, throughput is enhanced as fewer NAK handshakes will be
sent. Using two endpoints would mean that you could theoretically send
two lots of data down to two endpoints and seemingly double your
throughput, but the packet arrival order (when comparing distinct
endpoints) is a function of the host stack.
> When i fire the different endpoints is there a
> guaranteed order of incoming packets, e.g. when i fire
> endpoint 5 and then 11, then 5 and then 11, do i received the
> packet 1,2,3,4 in same order ?
No, potentially not. The host stack might decide to do EP5 then 11, or
11 then 5, IIRC.
> What throughput do i get at all, with and without using DMA ?
No idea. Haven't tested it yet. However, with 64-byte packets, you
should be able to achieve a good throughput. I'm not convinced that DMA
is worth it on 64-byte packets even, and the LPC DMA controller looks
rather hairy for USB.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and now MAXQ processors