BBC BASIC for Windows
Programming >> Communication and Input/Output >> Detecting enumerated COM ports
http://bb4w.conforums.com/index.cgi?board=communication&action=display&num=1454334441

Detecting enumerated COM ports
Post by acexbe on Feb 1st, 2016, 12:47pm

Hello,

I am playing with the MCP2221 from Microchip.
This is a USB to SERIAL/I2C integrated chip combo.

When you use commercial USB to RS232 converters, they have one huge disadvantage, plugging into one usb-port assigns this for example to com5, unplug and plugging into another usb-port assigns another com-number com6.

With the MCP2221, you can enumerate the serial number of the chip, this results in keeping the first time plugged in serial com portnumber.
The enumeration is in the form of a ten digit number.

Now I want to autodetect these devices.(two of them connected)

I can detect the used serial numbers with the "PnpEntity" class viewing the "PNPDeviceID" member (filtering on the VID and PID of the used chips).
VID= Vender ID
PID= Product ID

For detecting the com-port assigned numbers I use the "Serialport" class member "Name" with filtering for "USB Serial Port ("

Now I know the two used serial numbers and the two assigned USB COMM ports.

The question now is how to detect witch serial number belongs to witch COMM port?


Re: Detecting enumerated COM ports: follow-up
Post by obby on Feb 2nd, 2016, 11:22am

The MCP2221-chip can be configured with their provided tool (MCP2221 Utility).

I changed the PID (product ID) of one of both chips from 00DD to 00DE and programmed this into the chip.
Result is that the default driver did not work anymore.
This is normal as the driver searches for PID 00DD.

the driver uses the file mchpcdc.inf
Here you can change the PID settings. (using notepad)

After this you have to install this second modified driver.

both chips can now be identified by their individual PID and they have their individual driver.

I know this is a workaround, but it works.

A neater way is always welcome ...

Regards to the group,

Manuel