View previous topic :: View next topic |
Author |
Message |
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Mon Jul 25, 2022 4:47 am Post subject: Com Helper - you immediately know which port it is |
|
|
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 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 |
|
|
JC
Joined: 15 Dec 2007 Posts: 586 Location: Cleveland, OH
|
Posted: Tue Jul 26, 2022 2:20 am Post subject: |
|
|
What a great little program!
JC |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Tue Jul 26, 2022 4:39 am Post subject: |
|
|
Happy customers wanted option that shows all existing ports so I added it! Click on Icon for that.
List is updated everytime something change
I also have version for WinXP if anyone interested. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5922 Location: Holland
|
Posted: Tue Jul 26, 2022 8:17 am Post subject: |
|
|
very nice indeed
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5922 Location: Holland
|
Posted: Tue Jul 26, 2022 8:17 am Post subject: |
|
|
very nice indeed
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 |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Wed Jul 27, 2022 11:16 am Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5922 Location: Holland
|
Posted: Wed Jul 27, 2022 7:40 pm Post subject: |
|
|
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 |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Wed Jul 27, 2022 7:47 pm Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5922 Location: Holland
|
Posted: Wed Jul 27, 2022 7:55 pm Post subject: |
|
|
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 but if that is desired i can have a look.
i hope you do understand what i meant. _________________ Mark |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Wed Jul 27, 2022 8:46 pm Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5922 Location: Holland
|
Posted: Wed Jul 27, 2022 9:13 pm Post subject: |
|
|
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 |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Wed Jul 27, 2022 9:46 pm Post subject: |
|
|
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 |
|
|
|