Pages: 1 [2]   Go Down
Author Topic: Arduinos and Windows COM ports  (Read 1801 times)
0 Members and 1 Guest are viewing this topic.
Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a little background on how Windows assigns COM port numbers:

The Arduino UNO has a unique serial number defined in it's USB descriptor. Windows uses the VID/PID and serial number to determine if it has already seen this device before. If it finds a match for this combination, then it will use the driver and settings it has already used for that device. If it does not find a match then it will create a new entry in the registry and assign a new COM port for that device.

Windows uses the following registry key to determine which COM ports have already been assigned and will assign the next available COM port number to each new device.

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/COM Name Arbiter

The data field COMDB contains a bit mask of the COM ports already assigned. For example, on a system that has only two COM ports assigned COM1 and COM2, the COMDB value will be 03 00 00 00 … The first two bits are set in the first byte and all the rest are not set.

You can edit this registry setting and set the value of COMDB to 0. After you reboot the system, Windows will automatically re-assign any built in COM ports; like COM1 and COM2 and then any new devices added will start at COM3 and increment from there.  Any devices that have already been assigned will still end up using the COM port that was assigned at the time it was added. The COM Name Arbiter key is only used to figure out what ports have already been assigned and what the next one should be.

If you want to remove entries of UNOs already added to the system, you will need to remove the  corresponding registry entries. All UNO devices will be under the following registry entry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2341&PID_0001

Under this key you will find entries for each unique serial number. You could remove any unwanted devices from the registry by deleting the keys you no longer want. If one of the removed devices was ever attached to the system again, you will need to go through the installation process again, as if it was the first time.

I am not sure any of this information will help you solve your problem, but hopefully it will help explain why Windows behaves the way it does when a new UNO is connected to the system.

Here are some links for further detail:
http://rtshiva.com/2009/05/19/usb-specification-and-windows-limitation-on-serial-numbers/
http://blogs.msdn.com/b/oldnewthing/archive/2004/11/10/255047.aspx
Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 3
Posts: 258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I am not sure any of this information will help you solve your problem, but hopefully it will help explain why Windows behaves the way it does when a new UNO is connected to the system.


I don't know if your post helped cappy2112, the original poster, but it did help me. Thanks for the information!
Logged

Pages: 1 [2]   Go Up
Jump to: