libftdi Archives

Subject: Re: FT2232H asynchronous maximum data rates?

From: Caleb Kemere <ckemere@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 19 Jun 2011 23:39:39 -0700
On Fri, Jun 17, 2011 at 1:23 PM, Caleb Kemere <ckemere@xxxxxxxxx> wrote:
> On Fri, Jun 17, 2011 at 1:07 PM, Uwe Bonnes
> <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>>>>> "Caleb" == Caleb Kemere <ckemere@xxxxxxxxx> writes:
>>
>>    Caleb> I've noticed previous threads where folks have used the
>>    Caleb> synchronous FIFO mode of the FT2232H and gotten quite reasonable
>>    Caleb> sustained transfer rates (15 MB/s). I'm struggling to get 6.5
>>    Caleb> MB/s (without the buffer on the chip filling up). Is this an
>>    Caleb> issue of the asynchronous FIFO mode, or am I somehow not pulling
>>    Caleb> data off on the PC fast enough?
>>
Uwe> Otherwise, how do you read on the PC side? Do yo do asynchronous reads like
Uwe> in libftdi-1.0/src/ftdi_stream.c?

I did test the asynchronous mode, but now I think I've distilled the
essence of the test down to the following really simple (blocking)
code:

int transferred = 0;
int bytes = 0;
while (bytes < MAXIMUM_TRANSFER) {
    last_result = libusb_bulk_transfer(ftdi.usb_dev, ftdi.out_ep,
buffer, bufferSize, &transferred, 1000);
    if ((last_result > 0) | (transferred == 2))
      break;
    else
      bytes+= transferred;
}

I've been messing around with different values for the read-chunksize
of the FT2232H and the bufferSize of the bulk transfer. As a reminder,
my data streams from the FPGA to the FT2232H at 6.5 MB/s. With that, I
can consistently read for about a 30 s or so before I get a buffer
overflow (at half speed, I can go for about 3 times that long). It
seems like the USB subsystem should be able to handle that data rate
for an arbitrary length of time, so I'm wondering what I could be
doing wrong...

thanks!
– caleb

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread