Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Com Helper - you immediately know which port it is

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Mon Jul 25, 2022 4:47 am    Post subject: Com Helper - you immediately know which port it is Reply with quote

This is not strictly Bascom realted so I post it here.
If you often plug in some devices that are mounted as virtual port, for example USB<>UART converters, Arduinos or ESP`s, then this little, tiny program can be handy for you.
It immediately gives you info about new COM port number.
It resides in the Windows Tray and can be configured to start with Windows startup.
One configuration more is not using the Windows notifications. Instead another info "fade in and nicely fade out" on any new port event.

I wrote it in Basic Very Happy in VB.NET 2022 Studio. If anyone interested I can attach sources.

There is idea from customers to add list of available ports when click on Icon. I try to add this future.

Back to top
View user's profile Visit poster's website
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 586
Location: Cleveland, OH

usa.gif
PostPosted: Tue Jul 26, 2022 2:20 am    Post subject: Reply with quote

What a great little program!

JC
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Tue Jul 26, 2022 4:39 am    Post subject: Reply with quote

Happy customers wanted option that shows all existing ports so I added it! Click on Icon for that.
List is updated everytime something change Wink



I also have version for WinXP if anyone interested.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue Jul 26, 2022 8:17 am    Post subject: Reply with quote

very nice indeed Very Happy
notice that bascom had the option 'use existing com ports'. when checked you only get the com ports that are available in your system. and when new ones are detected they are added automatically.
but it only shows com1, com2 etc. not a nice name. and it also does not show which was recently added. a good idea.

i have added a registry key so i always get the same com port number. i do not like com 100, 101, etc. each time i plug in some new cable/chip. windows assigns a new com based on the serial.
i forgot how to do it but you can google it. it is simple and when developing, very effective.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue Jul 26, 2022 8:17 am    Post subject: Reply with quote

very nice indeed Very Happy
notice that bascom had the option 'use existing com ports'. when checked you only get the com ports that are available in your system. and when new ones are detected they are added automatically.
but it only shows com1, com2 etc. not a nice name. and it also does not show which was recently added. a good idea.

i have added a registry key so i always get the same com port number. i do not like com 100, 101, etc. each time i plug in some new cable/chip. windows assigns a new com based on the serial.
i forgot how to do it but you can google it. it is simple and when developing, very effective.

_________________
Mark
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Wed Jul 27, 2022 11:16 am    Post subject: Reply with quote

Mark,

A thought to consider.

I use the MCS Bootloader for >80% of the time from within Bascom. I thought it would make it easier if the IDE selects the last COM Port when it is plugged in for programming the chip. This way, it will speed things up quite a bit.

E
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed Jul 27, 2022 7:40 pm    Post subject: Reply with quote

enniom wrote:
Mark,

A thought to consider.

I use the MCS Bootloader for >80% of the time from within Bascom. I thought it would make it easier if the IDE selects the last COM Port when it is plugged in for programming the chip. This way, it will speed things up quite a bit.

E


i think that this is a better option : https://www.ftdichip.com/Support/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
That way you get the same com number. i could add this to bascom too so it change the registry.

what you want is that you get com100, com101, com102 and that bascom uses the last one?

_________________
Mark
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Wed Jul 27, 2022 7:47 pm    Post subject: Reply with quote

Thanks Mark for taking the time to answer.

Yes, the last inserted and found COM port is then used by the Bootloader programming option.

E
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed Jul 27, 2022 7:55 pm    Post subject: Reply with quote

but dont you care that all these com ports mess up your system? you prefer to have a new com port for each similar device? you do not prefer they all have the same com number?
changing reg is for production when you program a lot of devices. i always try to understand user wishes Smile but if that is desired i can have a look.
i hope you do understand what i meant.

_________________
Mark
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Wed Jul 27, 2022 8:46 pm    Post subject: Reply with quote

Mark,

Yes, I do understand what you mean about each new COM port having its own number. It is cumbersome. At the moment, I live with it until the count gets to about 50 or so, then I use Device Manager to delete the idle ports and the count starts over again.

I would prefer to have the same COM port number for similar devices ... but I have not understood how to change the registry to do this.

E
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed Jul 27, 2022 9:13 pm    Post subject: Reply with quote

ok, changing the reg is simple.
run regedt32 with admin rights.
make a backup of the registry

then check this :

Use IgnoreHardwareSerialNumber Setting in the Registry
It is possible to make the system ignore a device's serial number and treat all devices with matching VID
and PID connected to the same USB port as if they were the same device.
This is achieved by adding a REG_BINARY value called IgnoreHWSerNum to the registry and setting it to 01.
This value is held in the registry key located at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum{Device VID, PID and interface}

For a default FTDI device ID (VID 0x0403, PID 0x6001), add the following registry REG_BINARY value set to 01:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum04036001
For port A of an FT2232 device with default VID and PID, the IgnoreHWSerNum string would be:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum0403601000
and for port B of an FT2232 device the IgnoreHWSerNum string would be:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum0403601001

As the FT2232 device also uses the Windows composite device driver, an additional IgnoreHWSerNum
entry is required to prevent Windows from creating additional composite driver registry entries:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum04036010


PROs: All devices have the same COM port assigned.
Do not need to alter the hardware.
Same settings work on all PCs.
Only needs setup once.
CONs: Need to be able to access the registry.

I use this. you can make it work for any brand.

_________________
Mark
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Wed Jul 27, 2022 9:46 pm    Post subject: Reply with quote

Thank-you Mark.

The instructions worked perfectly for Windows 10.

The FTDI chip we use most often is FT230XS ... so the registry entries are:
Quote:
- IgnoreHWSerNum04036015 [01]
- IgnoreHWSerNum04036010 [01]


Windows 11 has a different registry nomenclature. More investigation needed. Any hints would be appreciated.



[Edit: it turns out that the same registry modification also works on Windows 11.]

E
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum