libftdi Archives

Subject: RE: Help reviewing MPSSE layer + libfti class

From: Ryan Tennill <rtennill@xxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 24 Sep 2013 16:25:40 -0500
On Tue, 2013-09-24 at 14:04 -0700, Chaves, Kevin wrote:
Ø  I don't know if it effects MPSSE mode but you might check the latency timer. The latency timer tries to avoid partial data packets by waiting for more data to show up before transmitting. If you partially fill the buffer it waits for the timer (default is 16ms at least for FT232R) to expire before sending the packet.

You should be able to use ftdi_get_latency_timer() with a valid context and byte sized variable to get the timer in ms.

 

Is this related to the ftdi_set_latency_timer, in both of my examples I set it to 2

 

    status = ftdi_write_data_set_chunksize(fc, 512);

    status = ftdi_set_interface(fc, 0);

    status = ftdi_usb_reset(fc);

    status = ftdi_set_latency_timer(fc, 2);

    status = ftdi_setflowctrl(fc, SIO_RTS_CTS_HS);

    status = ftdi_set_bitmode(fc, 0, BITMODE_MPSSE);

    status = ftdi_usb_purge_buffers(fc);


Yes, it looks like you already found and are setting the latency timer to 2ms. With your USB monitoring can you tell if you're getting full or partial packets with this latency setting? I don't know how long the packet should be off the top of my head. I think the max per spec for high-speed USB2 is 512 bytes.

Ryan


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


Current Thread