Copyright © 2008-2014 Future Technology Devices International Limited
13
Document Reference No.: FT_000073
Advanced Driver Options AN_107 Application Note
AN_107 Version 2.53
Clearance No.: FTDI# 63
5.3
Limiting the Number of COM Ports That Can Be Installed
The number of FTDI virtual COM ports that may be installed in a system can be limited by setting
the MaxDevs parameter. MaxDevs defaults to 0, meaning that the feature is disabled and the
driver will always attempt to create a COM port. The default can be overridden by including a
nonzero MaxDevs value in the FTDIBUS.INF service key section.
[FtdiBus.NT.AddService]
AddReg = FtdiBus.NT.AddService.AddReg
[FtdiBus.NT.AddService.AddReg]
HKR,Parameters,"MaxDevs",0x00010001,3
In this example INF file fragment, the maximum number of devices is set to 3.
This value is held in the registry key located at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTDIBUS\Parameters\MaxDevs
If an attempt is made to install more than MaxDevs devices, a Code 10 error ("This device cannot
start") is generated for the new device.
Note that setting MaxDevs to a value other than zero will radically alter the behaviour of
the driver; please contact FTDI if you think you have to change MaxDevs.
5.4
Override EEPROM Driver Setting
In the case if FT232R, FT245R and FT2232 devices, the driver will read the device EEPROM to
determine whether to expose a COM port or not. The earlier B and AM series devices do not have
an EEPROM setting for driver type, so will default to installing a COM port. This feature can be
turned off and the choice of driver to load can be made through a setting in the installation file.
For a standard installation, the following sections can be added to FTDIBUS.INF to override the
EEPROM configuration and load the VCP driver:
[FtdiBus.NT.HW]
AddReg=FtdiBus.NT.HW.AddReg
[FtdiBus.NTamd64.HW]
AddReg=FtdiBus.NT.HW.AddReg
[FtdiBus.NT.HW.AddReg]
HKR,,"ConfigData",0x00010001,4
Bit 2 of the ConfigData parameter determines the driver to be loaded: if it is set to 1, the VCP
driver is loaded (as in the above example); otherwise, only the D2XX driver is loaded. Therefore,
adding the above sections to the installation file, and in particular setting the value of ConfigData
to 4, will cause the VCP driver to be loaded regardless of the EEPROM settings.
This method can be extended for the dual channel FT2232 device. In this case, new sections have
to be created for each channel to allow the channels to be configured and installed separately. The
following fragments show the additional changes that are necessary to configure channel A to load
the D2XX driver only, and channel B to load the VCP driver.
[FtdiHw]
%USB\VID_0403&PID_6010&MI_00.DeviceDesc%=FtdiBusA,USB\VID_0403&PID_6010&MI_00
%USB\VID_0403&PID_6010&MI_01.DeviceDesc%=FtdiBusB,USB\VID_0403&PID_6010&MI_01
[FtdiHw.NTamd64]
%USB\VID_0403&PID_6010&MI_00.DeviceDesc%=FtdiBusA.NTamd64,USB\VID_0403&PID_6010&MI_00
%USB\VID_0403&PID_6010&MI_01.DeviceDesc%=FtdiBusB.NTamd64,USB\VID_0403&PID_6010&MI_01
[FtdiBusA.NT]
Copyright © 2008-2014 Future Technology Devices International Limited
14
Document Reference No.: FT_000073
Advanced Driver Options AN_107 Application Note
AN_107 Version 2.53
Clearance No.: FTDI# 63
CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
AddReg=FtdiBusA.NT.AddReg
[FtdiBusA.NTamd64]
CopyFiles=FtdiBus.NTamd64.Copy,FtdiBus.NTamd64.Copy2,FtdiBus.NTamd64.Copy3
AddReg=FtdiBusA.NT.AddReg
[FtdiBusA.NT.HW]
AddReg=FtdiBusA.NT.HW.AddReg
[FtdiBusA.NTamd64.HW]
AddReg=FtdiBusA.NT.HW.AddReg
[FtdiBusA.NT.HW.AddReg]
HKR,,"ConfigData",0x00010001,0
[FtdiBusA.NT.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
[FtdiBusA.NTamd64.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
[FtdiBusB.NT]
CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
AddReg=FtdiBusB.NT.AddReg
[FtdiBusB.NTamd64]
CopyFiles=FtdiBus.NTamd64.Copy,FtdiBus.NTamd64.Copy2,FtdiBus.NTamd64.Copy3
AddReg=FtdiBusB.NT.AddReg
[FtdiBusB.NT.HW]
AddReg=FtdiBusA.NT.HW.AddReg
[FtdiBusB.NTamd64.HW]
AddReg=FtdiBusA.NT.HW.AddReg
[FtdiBusB.NT.HW.AddReg]
HKR,,"ConfigData",0x00010001,4
[FtdiBusB.NT.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
[FtdiBusB.NTamd64.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
Note that the value of ConfigData is set to 0 for channel A (D2XX) and the value of ConfigData is
set to 4 for channel B (VCP) to achieve the required configuration. Of course, if ConfigData is not
included in the installation file, the EEPROM settings will determine which driver is loaded.
The ConfigData parameter is held in the registry under the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\{Device VID, PID and
interface}\{Serial number}\DeviceParameters\ConfigData
The COM port can also be suppressed after installation through the Advanced tab of the
USB Serial
Converter properties page
which is available through the device manager.