File Name: AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
File Size: 666.93 KB
File Type: Application/pdf
Last Modified: 2 years
Status: Available
Last checked: 4 days ago!
This Document Has Been Certified by a Professional
100% customizable
Language: English
We recommend downloading this file onto your computer
Application Note AN_132Re-Assigning COM Port Numbers Using the Windows Registry Version 1.1 Issue Date: 2016-04-27This application note illustrates how to re-assign automatically assigned FTDI COM port numbers using the Window OS registry
Future Technology Devices International Limited (FTDI) Unit 1,2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 E-Mail (Support): [email protected] Web: http://www.ftdichip.com Copyright © Future Technology Devices International Limited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1Table of Contents1 Introduction ................................................................. 22 System COM Port Assignment ........................................ 33 How to Re-Assign COM port numbers by registrymodification ...................................................................... 4 3.1 Open the OS registry .............................................................. 4 3.1.1 Windows XP ...........................................................................................4 3.1.2 Windows 7 Onwards ................................................................................4 3.2 Re-assign the COM Name Arbiter in ComDB............................. 7 3.3 Import the modifed FTDIUSB registry file ............................... 94 Contact Information .................................................... 13Appendix A - References .................................................. 14 Acronyms and Abbreviations .........................................................14Appendix B – List of Tables & Figures ............................... 15 List of Figures ...............................................................................15Appendix C - Revision History .......................................... 16 1P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 11 IntroductionThis application note describes how to re-assign the COM port numbers allocated during installation onWindows operating systems by modifying registry entries. The application note provides a walkthroughof manually editing the registry, but the same technique could be employed by a program
WARNING: Any edits made to a PC registry may be harmful to the operation of the PC. As suchwe recommend you create a backup of the registry before making any changes. FTDI cannotbe held responsible for any damage done as a result of incorrect manual editing of theregistry
2P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 12 System COM Port AssignmentCOM ports are assigned to FTDI devices during installation, based on the next free port as indicated bythe PC registry. In most systems this would imply starting at COM3 as COM 1 and COM2 are usuallyreserved for legacy COM ports. If COM3 is already in use, the next available COM port index will beclaimed. In the case of multiple interface chips, such as the FT2232H or FT4232H, a co -installer is usedto claim consecutive COM ports for the interfaces of the device. If three FTDI FT4232H devices areconnected to a PC, then 12 COM ports will appear to the operating system. In the example below , the PChas assigned these COM ports with com port numbers from COM3 to COM14
Figure 1 - System COM Port Assignment 3P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 13 How to Re-Assign COM port numbers by registry modificationIn the example above, the operating system automatically assigns the 12 COM ports from COM3 toCOM14. If it is required to re-assign the COM port numbers without setting each port individually, thenthe FTDIUSB file in the registry can be used to do this. Follow the procedures below to re-assign COMPort numbers using the operating system registry
3.1 Open the OS registry3.1.1 Windows XPTo open the OS registry, select the “Start” button and press the “Run”. In the pop-up box that appears,type “regedt32” and press enter to access the registry. This is shown in the figure below
Figure 2 - Accessing the Registry (Windows XP)3.1.2 Windows 7 OnwardsTo open the OS registry, select the “Start” button and in the search box type “regedt32”. This shoulddisplay the registry executable as shown below in the image to the left. Right click on this to open thecontext menu where you should select the “Run as administrator” option, as shown in the image to theright. If you do not select “Run as administrator” the remaining steps will not work
4P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1 Figure 3 - Accessing the Registry (Windows 7)Within the registry, navigate to the following area to access all FTDI devices:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS
Select FTDIBUS and then under the “file” pull-down menu select “export” – as shown in the figure below
This will export the FTDIBUS registry key, sub-keys and values to a file
Figure 4 - Export the FTDIBUS Registry to a FileRight click on this saved file and select “Edit” to open the file, as shown in the figure below
5P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1 Figure 5 - Edit the Registry FileIn the FTDIUSB.reg file, modify the “FriendlyName” and “PortName” in the file for each port which needsto re-assigned
Figure 6 - Modifying the FTDIUSB.reg Registry FileFor example to re-assign COM7 to COM17 modify the FTDIUSB.reg file as follows: 6P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1Replace FriendlyName from “USB Serial Port (COM7)” to “USB Serial Port (COM17)”, and modifyPortName from “COM7” to “COM17” at the same time. This will re-assign COM7 to COM17 after theregistry file has been uploaded (illustrated later)
The same method can be used to modify each port
Note: Care should be taken that the same COM port number is not repeated
3.2 Re-assign the COM Name Arbiter in ComDBIf COM3 to COM14 are re-assigned to COM13 to COM24, then it is necessary to free up the unused comports (COM3~COM12) and allocate the new additional ports COM15~COM24. To do this it is necessary tomodify the ComDB database by using the following procedure
Open the registry and navigate to the following area of the registryHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name ArbiterOpen the “ComDB” as shown in the figure below. The example shows that the original value of “ComDB”is as follows:ComDB original value = FF 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00The ComDB value is a bit mask of COM ports already allocated. This value is equivalent to COM3~COM14
The first byte “FF” equates to the com ports COM8~COM1 and indicates that these COM ports areoccupied. The second byte “3F” equates to the com ports COM14~COM9 and this indicates that theseCOM ports are occupied. (Note that COM1 and COM2 are the COM port of motherboard)
7P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1 Figure 7 - Editing the ComDB DatabaseTo allocate the COM port numbers COM13~COM24, it is necessary to modify the ComDB value as follows:ComDB new value = 03 F0 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00This is shown in the following diagram: Figure 8 - Change the Value 3The first byte “03” is used for COM2 and COM1 of motherboard. COM8~COM3 are not used
8P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1The second byte “F0” is equates to COM12~COM9 that are not used and COM16~COM13 that areoccupied
The third byte “FF” equates to COM24~COM17 which are occupied
Note: The first byte controls COM8~1, the second byte controls COM16~9, the third bytecontrols COM24~COM17 and so on. A value=0 means that the port is not used. A value=1means that the port is occupied
3.3 Import the modifed FTDIUSB registry fileWhen the FTDIUSB registry file has been modified it is necessary to import the file back into the registry
To be able to do this a user must have full access control rights to modify it in the registry
To modify the permissions, right click on the FTDIUSB folder in the registry and select the Permissions toenable the permission for modification – as shown in the figure below - Figure 9 - Modifying Registry Permissions for FTDIUSB FolderThe following window will appear. Select “full control” then press OK
9P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1 Figure 10 - Allow Full Control Access Rights to the FTDIUSB RegistryNote: You may encounter an “Access is denied” error as per the below diagram. If so follow the belowsteps
Figure 11 - "Access Denied" Message WindowOpen the Permissions window for FTDIBUS again and click on the advanced button instead. In the“Advanced Security Settings” window click on the “Owner” tab. If the current owner is not you thenchange to you by highlighting your name in the “Change owner to:” window
Click Apply > OK
10P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited AN_132 Re-Assigning COM Port Numbers Using the Windows Registry V ers ion 1 .1 D oc ument Reference N o.: FT _000196 C learance N o.: FT DI# 1 2 1Repeat the steps at the beginning of section 3.3
Note: It is always a good practice reversing the changes back to their default settings, once you havemade the necessary changes
Next import the modified FTDIUSB file. Select Import and choose the modified registry file to import theregistry file. This is shown in the following figure: Figure 12 - Importing the FTDIUSB File to the RegistryTo check that the procedure has worked, open the device manager and press “Scan for hardwarechanges”. This should show the new COM port assignments as illustrated in the following figure: 11P roduc t PageD oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
AN_132 Re-Assigning COM Port Numbers Using the Windows Registry Version 1.1 Document Reference No.: FT_000196 Clearance No.: FTDI# 121 13 Product Page
The HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionPorts registry key contains the list of all assigned COM port numbers. You can remove all unnecessary port reservations. In our example, we’ll leave only COM3 and delete the rest ports;
First of all, try to reassign the COM port number for a specific COM device manually. Suppose that the necessary COM port is already busy and we would like to free it. Select View->Show Hidden Devices in the console menu. Expand Ports (COM & LPT) branch and find the device, which is assigned the necessary COM port in the list.
The registry settings for a legacy COM port are under a corresponding legacy COM port subkey that is under the ..ServicesSerialParameters key. The following entry values are the same as described for a Plug and Play serial device: The following additional entry values are used with legacy COM ports:
The freed up COM port can be assigned to another device. Find your device in the same branch, and open the Properties window. Then go to the Port Settings tab and click Advanced. In the dropdown list, select the free COM port.