USB to Serial adapter enumeration.

G

Guest

My embedded device uses two CP2103 USB to Serial Port adapters and they seem
to work fine. However, they don't always seem to enumerate in the same order
from device to device. To address this I'm thinking about writing a setup
program that listens to one of the ports so it can accurately assign COM1 and
COM3 to them. However, I'm not sure how to programatically change say COM3 to
COM1. Any ideas?
 
K

KM

Not certain about the API (I am sure it exists) but you can always change the port assignment in registry. Check out the following
key at run time:
[HKLM\SYSTEM\CurrentControlSet\Enum\<your device class>\<Vid&Pid>\Device Parameters],"PortName"
Find the ones that will point to COM1 and COM3 and swap the values.

You can also change that manually with Device Manger GUI (Advanced properties on a port node). Here you can capture the
reg.modifications with Intrl5 or Regmon.
 
G

Guest

Ok, I used InCtrl5 and now have a report with a ton of registry changes in
it. Should I write a perl script to parse the file and change it to a .reg
file or is there an easier way?

KM said:
Not certain about the API (I am sure it exists) but you can always change the port assignment in registry. Check out the following
key at run time:
[HKLM\SYSTEM\CurrentControlSet\Enum\<your device class>\<Vid&Pid>\Device Parameters],"PortName"
Find the ones that will point to COM1 and COM3 and swap the values.

You can also change that manually with Device Manger GUI (Advanced properties on a port node). Here you can capture the
reg.modifications with Intrl5 or Regmon.

--
=========
Regards,
KM

My embedded device uses two CP2103 USB to Serial Port adapters and they seem
to work fine. However, they don't always seem to enumerate in the same order
from device to device. To address this I'm thinking about writing a setup
program that listens to one of the ports so it can accurately assign COM1 and
COM3 to them. However, I'm not sure how to programatically change say COM3 to
COM1. Any ideas?
 
K

KM

First of all, you may only want to pay attention to the reg.path I mentioned earlier in this thread. It may substantially narrow
down the search with in the report file.

Second, that almost useless reporting format of Inctrl5, in my opinion, is the reason I don't use the tool for registry modification
monitoring. I use RegSnap for heavy applications or Regmon for light drivers or apps.

--
=========
Regards,
KM
Ok, I used InCtrl5 and now have a report with a ton of registry changes in
it. Should I write a perl script to parse the file and change it to a .reg
file or is there an easier way?

KM said:
Not certain about the API (I am sure it exists) but you can always change the port assignment in registry. Check out the
following
key at run time:
[HKLM\SYSTEM\CurrentControlSet\Enum\<your device class>\<Vid&Pid>\Device Parameters],"PortName"
Find the ones that will point to COM1 and COM3 and swap the values.

You can also change that manually with Device Manger GUI (Advanced properties on a port node). Here you can capture the
reg.modifications with Intrl5 or Regmon.

--
=========
Regards,
KM

My embedded device uses two CP2103 USB to Serial Port adapters and they seem
to work fine. However, they don't always seem to enumerate in the same order
from device to device. To address this I'm thinking about writing a setup
program that listens to one of the ports so it can accurately assign COM1 and
COM3 to them. However, I'm not sure how to programatically change say COM3 to
COM1. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top