If the developer does not have control over the application software to allow for buffering the data there, the FTDI driver provides an option to buffer the data fromo the application in the driver before sending the data out over USB to the device.
The Buffered Writes option is enabled through bit 10 of the first DWORD of the ConfigData entry in the FTDIPORT.INF file. This is the same entry that contains the Baud rate table.
The first DWORD is shown in bold in the INF fragment below.
[FtdiPort232.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,D0,80
|
|
Please note that the ConfigData entry is byte-reversed, so MSB the DWORD reads 3F 3F 00 01 and the least significant bit is Bit 0. With Buffered Writes disabled, the DWORD would read 3F 3F 00 01. With Buffered Writes enabled, the DWORD would read 3F 3F 04 01.
In addition to enabling buffered writes in the Config Data entry, some parameters must be set up to control the behaviour. These parameters can also be set up in FTDIPORT.INF as follows:
[FtdiPort232.NT.HW.AddReg]
|
HKR,,"WriteBufferSize",0x00010001,4096
|
HKR,,"WriteBufferThreshold",0x00010001,20
|
HKR,,"WriteLatency",0x00010001,6
|
|
These values are held in the registry under this key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\{Device VID, PID and serial number}\0000\Device Parameters
|
These parameters are specific to the application. As such, they will require to be "tuned" to provide best performance.