方法一、不修改PC端驱动中的PID_VID,把FT232的USB接口当作一个通用的USB转串口<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
当FT232BM的USB口与PC端相连时,PC端会提示发现USB Serial Converter,并自动弹出查找新硬件向导对话框,如下图:
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
找到FT232BM对应的通用驱动程序安装,安装完毕设备管理器则显示一个USB串行接口:
方法二、把FT232的USB接口当作专用的USB转串口
(需要在FT232外部加串行的EEPROM,用来存储USB VID、PID及设备信息。)
FT232内部存有VID和PID,且每一个同型号的芯片的VID和PID都是一样的,FT232在上电时首先读取外部的VID、PID及设备信息,如果外部没有EEPROM存储器件,则使用芯片内部的VID、PID及设备信息。
由于是专用的USB转串口,FT232需要重新配制VID 和PID 以及设备描述信息,EERPOM的配制可用专用的EERPOM烧写工具,也可用MProg3.0_Setup.exe+配制文件.ept文件来配制,方法如下
1、配制EEPROM
安装并运行 MProg3.0_Setup.exe 。打开配制文件:
点编程,将配制文件写入EEPROM(FT232外置)。
2、修改PC端驱动的INF文件
将PID和VID的序号改成和配制文件中的一致
[FtdiHw]
%USB\VID_1987&PID_0724.DeviceDesc%=FtdiBus,USB\VID_1987&PID_0724
%USB\VID_0403&PID_6001.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6001
%USB\VID_0403&PID_6007.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6007
%USB\VID_0403&PID_6008.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6008
%USB\VID_0403&PID_6009.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6009
%USB\VID_0403&PID_0232.DeviceDesc%=FtdiBus,USB\VID_0403&PID_0232
[Strings]
Ftdi="liu_xf"
DriversDisk="FTDI USB Drivers Disk"
USB\VID_1987&PID_0724.DeviceDesc="《小发和你共同玩USB》之USB转串口"
USB\VID_0403&PID_6001.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6007.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6008.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6009.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_0232.DeviceDesc="USB Serial Converter"
WINUN="Software\Microsoft\Windows\CurrentVersion\Uninstall"
FtdiBus.SvcDesc="USB Serial Converter Driver"
3、插上USB,按照提示安装驱动
注意:如果PC端驱动中的PID VID与配制文件中的PID VID不一致,将照成驱动程序无法安装。
三、配制EEPROM时出现MPorg与硬件不能正常连接时的几点说明
用MProg配制EEPROM时,请确保配制文件.ept正确且配制成功后再拔插USB接口,否则配制完成重新拔插USB端口时,会自动弹出查找新硬件向导,此时若要点击MProg重新配制,则会出现无法连接的情况。只有安装完驱动,再打开MProg才能重新建立连接。
如果EEPROM配制成功,但在安装驱动的时候出现错误,导致硬件无法使用,同时还会出现硬件与MProg无法连接的现象,需重新安装正确的驱动才能正常;由于windows系统内保存了该硬件的VID和PID,可能会导致正确的驱动不能被安装。解决办法可尝试换一台电脑,在新的电脑上将正确的驱动安装后,再用MPorg将硬件的EEPROM内的配制文件擦除即可;此时再回来原来的电脑上,即可与MPorg正常连接。
四、配制文件.ept和PC端驱动安装信息文件.inf的修改
通用的FT<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />232M.ept文件
―――――――――――――――――――――――――
[Basic Details]
Device Type="3" //设备类型为FT232BM
VID PID Type="2"
USB VID="1987" //生产厂商ID
USB PID="0724" //产品ID
[USB Power Options]
Bus Powered="1"
Self Powered="0"
Max Bus Power="100"
[USB Serial Number Control]
Prefix=FT
Use Fixed Serial Number="0"
Fixed Serial Number="20090414"
[USB Remote WakeUp]
Enable Remote WakeUp="0"
[Windows Plug and Play]
Enable Plug and Play="1"
[USB String Descriptors]
Manufacturer=Liu_xf //制造商名称
Product=USB Serial Port //产品名称
[Programming Options]
Only Program Blank Devices="0"
[BM Device Specific Options]
USB Version Number="1"
Disable Serial Number="1"
IO Pin Pull Down in Suspend="0"
[Dual Device Specific Options A]
RS 232 mode="0"
245 FIFO mode="0"
245 CPU FIFO mode="1"
OPTO Isolate mode="0"
High
Current Drive=0[Dual Device Specific Options B]
RS 232 mode="1"
245 FIFO mode="0"
245 CPU FIFO mode="0"
OPTO Isolate mode="0"
High
Current Drive=0[Dual Device Driver Options A]
Virtual ComPort Driver="0"
D2XX Driver="1"
[Dual Device Driver Options B]
Virtual ComPort Driver="1"
D2XX Driver="0"
[R Device Specific Options]
Invert TXD="0"
Invert RXD="0"
Invert RTS#=0
Invert CTS#=0
Invert DTR#=0
Invert DSR#=0
Invert DCD#=0
Invert RI#=0
C0 Signal="-1"
C1 Signal="-1"
C2 Signal="-1"
C3 Signal="-1"
C4 Signal="-1"
Enable Ext Osc="0"
High Current I/O=0
Load D2XX Driver="0"
In EndPoint Size="0"
―――――――――――――――――――――――――
PC端的.inf文件
――――――――――――――――――――――――――――――
; FTDIBUS.INF
; Copyright (c) 2000-2004 FTDI Ltd.
[Version]
signature="$CHICAGO$"
Class=USB
ClassGUID={36fc9e60-c465-11cf-8056-444553540000}
Provider=%FTDI%
CatalogFile=ftdibus.cat
DriverVer=04/14/2009,1.00.2154
[SourceDisksNames]
1=%DriversDisk%,,,
[SourceDisksFiles]
ftcomms.vxd = 1
ftserial.sys = 1
ftsenum.vxd = 1
ftsenum.sys = 1
ftsermou.vxd = 1
ftserui.dll = 1
ftlang.dll = 1
ftdibus.sys = 1
ftdiunin.exe = 1
ftdiunin.ini = 1
ftdiun2k.ini = 1
[DestinationDirs]
FtdiBus.Copy1 = 11
FtdiBus.Copy2 = 17
FtdiBus.NT.Copy = 10,system32\drivers
FtdiBus.NT.Copy2 = 11
[Manufacturer]
%Ftdi%=FtdiHw
[FtdiHw]
%USB\VID_1987&PID_0724.DeviceDesc%=FtdiBus,USB\VID_1987&PID_0724
%USB\VID_0403&PID_6001.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6001
%USB\VID_0403&PID_6007.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6007
%USB\VID_0403&PID_6008.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6008
%USB\VID_0403&PID_6009.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6009
%USB\VID_0403&PID_0232.DeviceDesc%=FtdiBus,USB\VID_0403&PID_0232
[ControlFlags]
ExcludeFromSelect=USB\VID_0403&PID_8372
ExcludeFromSelect=USB\VID_0403&PID_6001
ExcludeFromSelect=USB\VID_0403&PID_6007
ExcludeFromSelect=USB\VID_0403&PID_6008
ExcludeFromSelect=USB\VID_0403&PID_6009
ExcludeFromSelect=USB\VID_0403&PID_0232
[FtdiBus]
CopyFiles=FtdiBus.Copy1,FtdiBus.Copy2
AddReg=FtdiBus.AddReg, FtdiBusUnInst.Reg
RemoveDevice=FtdiBus.RemDev
[FtdiBus.HW]
AddReg=FtdiBus.AddReg.HW
[FtdiBus.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,ftserial.sys
[FtdiBus.AddReg.HW]
HKR,,"UpperFilters",0x00010000,"ftsenum.sys"
[FtdiBus.Copy1]
ftcomms.vxd
ftsenum.vxd
ftsermou.vxd
ftserial.sys
ftsenum.sys
ftserui.dll
ftdiunin.exe
ftdiunin.ini
[FtdiBus.Copy2]
ftdibus.inf
ftdiport.inf
ftsermou.inf
[FtdiBus.RemDev]
DelFiles=FtdiBus.Delfiles
DELKEY=HKLM,%WINUN%\FTDICOMM
[FtdiBusUnInst.Reg]
HKLM,%WINUN%,"FTDICOMM"
HKLM,%WINUN%\FTDICOMM , "UninstallString",,"%11%\ftdiunin.exe %11%\ftdiunin.ini"
HKLM,%WINUN%\FTDICOMM , "DisplayName",,"FTDI USB-to-Serial Converter Drivers"
[FtdiBus.DelFiles]
FTCOMMS.VXD
ftsenum.vxd
ftsermou.vxd
FTSERIAL.SYS
FTPORTS.INF
FTDICOM.INF
ftdibus.inf
ftdiport.inf
ftsenum.sys
ftserui.dll
ftdiunin.exe
ftdiunin.ini
;---------------------------------------------------------------;
; For Win2000 ...
;
[FtdiBus.NT]
CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
AddReg=FtdiBus.NT.AddReg,FtdiBusUnInst.NT.Reg
[FtdiBus.NT.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus_AddService
[FtdiBus_AddService]
DisplayName = %FtdiBus.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\system32\drivers\ftdibus.sys
LoadOrderGroup = Base
AddReg = FtdiBus_AddService.AddReg
[FtdiBus.NT.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,ftdibus.sys
[FtdiBus_AddService.AddReg]
HKR,Parameters,"MaximumTransferSize",0x10001,4096
;HKR,Parameters,"DebugLevel",0x10001,2
[FtdiBus.NT.Copy]
ftdibus.sys
[FtdiBus.NT.Copy2]
ftdiunin.exe
ftdiun2k.ini
[FtdiBusUnInst.NT.Reg]
HKLM,%WINUN%,"FTDICOMM"
HKLM,%WINUN%\FTDICOMM , "UninstallString",,"%11%\ftdiunin.exe %11%\ftdiun2k.ini"
HKLM,%WINUN%\FTDICOMM , "DisplayName",,"FTDI USB Serial Converter Drivers"
;---------------------------------------------------------------;
[Strings]
Ftdi="liu_xf"
DriversDisk="FTDI USB Drivers Disk"
USB\VID_1987&PID_0724.DeviceDesc="《小发和你共同玩USB》之USB转串口"
USB\VID_0403&PID_6001.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6007.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6008.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6009.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_0232.DeviceDesc="USB Serial Converter"
WINUN="Software\Microsoft\Windows\CurrentVersion\Uninstall"
FtdiBus.SvcDesc="USB Serial Converter Driver"
―――――――――――――――――――――――――――
五、符录
硬件原理图
用户1466950 2010-12-9 09:58
用户174417 2009-12-16 20:33