方法一、不修改PC端驅(qū)動(dòng)中的PID_VID,把FT232的USB接口當(dāng)作一個(gè)通用的USB轉(zhuǎn)串口
當(dāng)FT232BM的USB口與PC端相連時(shí),PC端會(huì)提示發(fā)現(xiàn)USB Serial Converter,并自動(dòng)彈出查找新硬件向?qū)υ捒?,如下圖:
找到FT232BM對應(yīng)的通用驅(qū)動(dòng)程序安裝,安裝完畢設(shè)備管理器則顯示一個(gè)USB串行接口:
方法二、把FT232的USB接口當(dāng)作專用的USB轉(zhuǎn)串口
(需要在FT232外部加串行的EEPROM,用來存儲(chǔ)USB VID、PID及設(shè)備信息。)
FT232內(nèi)部存有VID和PID,且每一個(gè)同型號(hào)的芯片的VID和PID都是一樣的,F(xiàn)T232在上電時(shí)首先讀取外部的VID、PID及設(shè)備信息,如果外部沒有EEPROM存儲(chǔ)器件,則使用芯片內(nèi)部的VID、PID及設(shè)備信息。
由于是專用的USB轉(zhuǎn)串口,F(xiàn)T232需要重新配制VID 和PID 以及設(shè)備描述信息,EERPOM的配制可用專用的EERPOM燒寫工具,也可用MProg3.0_Setup.exe+配制文件.ept文件來配制,方法如下
1、配制EEPROM
安裝并運(yùn)行 MProg3.0_Setup.exe 。打開配制文件:
點(diǎn)編程,將配制文件寫入EEPROM(FT232外置)。
2、修改PC端驅(qū)動(dòng)的INF文件
將PID和VID的序號(hào)改成和配制文件中的一致
[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="《小發(fā)和你共同玩USB》之USB轉(zhuǎn)串口"
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,按照提示安裝驅(qū)動(dòng)
注意:如果PC端驅(qū)動(dòng)中的PID VID與配制文件中的PID VID不一致,將照成驅(qū)動(dòng)程序無法安裝。
三、配制EEPROM時(shí)出現(xiàn)MPorg與硬件不能正常連接時(shí)的幾點(diǎn)說明
用MProg配制EEPROM時(shí),請確保配制文件.ept正確且配制成功后再拔插USB接口,否則配制完成重新拔插USB端口時(shí),會(huì)自動(dòng)彈出查找新硬件向?qū)?,此時(shí)若要點(diǎn)擊MProg重新配制,則會(huì)出現(xiàn)無法連的情況。只有安裝完驅(qū)動(dòng),再打開MProg才能重新建立連接。
如果EEPROM配制成功,但在安裝驅(qū)動(dòng)的時(shí)候出現(xiàn)錯(cuò)誤,導(dǎo)致硬件無法使用,同時(shí)還會(huì)出現(xiàn)硬件與MProg無法連接的現(xiàn)象,需重新安裝正確的驅(qū)動(dòng)才能正常;由于windows系統(tǒng)內(nèi)保存了該硬件的VID和PID,可能會(huì)導(dǎo)致正確的驅(qū)動(dòng)不能被安裝。解決辦法可嘗試換一臺(tái)電腦,在新的電腦上將正確的驅(qū)動(dòng)安裝后,再用MPorg將硬件的EEPROM內(nèi)的配制文件擦除即可;此時(shí)再回來原來的電腦上,即可與MPorg正常連接。
四、配制文件.ept和PC端驅(qū)動(dòng)安裝信息文件.inf的修改
通用的FT232M.ept文件
―――――――――――――――――――――――――
[Basic Details]
Device Type="3" //設(shè)備類型為FT232BM
VID PID Type="2"
USB VID="1987" //生產(chǎn)廠商ID
USB PID="0724" //產(chǎn)品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 //產(chǎn)品名稱
[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 Com Port Driver="0"
D2XX Driver="1"
[Dual Device Driver Options B]
Virtual Com Port 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="《小發(fā)和你共同玩USB》之USB轉(zhuǎn)串口"
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"
―――――――――――――――――――――――――――
五、符錄
硬件原理圖