Your browser does not allow scripts
Please click here to view a static table of contents without scripts
Adjusting the USB Transfer Size
Return to Introduction  Previous page  Next page
Again, when using the FTDI Virtual COM Port drivers the USB Transfer (buffer) size can be set in the port properties page. The initial buffer size is calculated from entries in the ftdiport.inf file - with the size of buffer allocated being equal to the .inf entry plus 1 multiplied by 64 (bytes).

So 0 is 64 bytes, and 3F is (63+1)*64 = 4096.

There are two entries in the INF file - the first one is the transmit buffer and the second is the receive buffer.

   
[FtdiPort.NT.HW.AddReg]

   HKR,,ConfigData,1,01,00,3F,3F,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,00,00

In the example above the two 3F's are the entries in question, with this line being set for 4k byte buffer size operation and

   [FtdiPort.NT.HW.AddReg]
   HKR,,ConfigData,1,01,00,00,00,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,00,00

being set for 64 byte buffer size operation.

When using FTDI's D2XX direct driver the function
FT_SetUSBParameters can be used to adjust the size of the USB block requested, as indicated in AN232B-03 D2XX Optimizing D2XX Data Throughput.