Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Multiple Microbridges on one Computer Post ReplyPost New Topic
<< Prev Page of 2
Author
Message << Prev Topic | Next Topic >>
MicroBlocks
Guru
Guru
Avatar

Joined: 12 May 2012
Location: Thailand
Online Status: Offline
Posts: 2034
Posted: 07 December 2017 at 4:05pm | IP Logged Quote MicroBlocks

Nope windows does exactly what it has to do according to the USB specs. :)
First VID/PID then serial number, then physical port on the computer.
This is done to get a unique identifier.
It works the same on all other OS'es.
If you have more then one that has the exact same configuration (The microbridge) then things get confusing.
If you swap the cables the OS has nothing to differentiate them and will enumerate them the same as it did the first time.
USB1 - COM1 - Microbridge A
USB2 - COM2 - Microbridge B
will change into
USB1 - COM1 - Microbridge B
USB2 - COM2 - Microbridge A

Only way to get them identified exactly the same is to leave them plugged in or plug them in the same port always. Imaging you have 2 USB ports on the computer and on one of them you connect a 7-port USB hub.
This will give you 8 USB ports in total.
If you have 8-microbridges they all get their own COM port.
If you unplug them and plug them in again in a different order then they get the number as before (USB port --> COM port).
You could therefore put a sticker on each USB port and write down the corresponding COM port. Once you plug something else in, then that port will get a new designation, If you afterwards but a microbridge in it again it will get a new comport number. As long as you plug the same device in the same port everything should stay the same. You can think of the PC assigning a comport to a USB and remembering which PID/VID/Serial number that was. If the same is plugged in no new enumeration is needed and the cached info is still valid. This is done to speed things up.




Edited by MicroBlocks on 07 December 2017 at 4:07pm


__________________
Microblocks. Build with logic.


Back to Top View MicroBlocks's Profile Search for other posts by MicroBlocks
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5166
Posted: 07 December 2017 at 5:10pm | IP Logged Quote Grogster

How come I sometimes have a situation where my USB3 hub(four ports) starts causing Windows to report: "The USB device you have plugged in has malfunctioned and Windows does not recognise it." On ANY port. Things that were working just fine.

I pull the cable to the USB3 hub(to reset it), wait a little, plug it back in, and everything works as it should.

What's getting Windows muddled there then? The hub?

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
BrianP
Newbie
Newbie


Joined: 30 March 2017
Location: Australia
Online Status: Offline
Posts: 39
Posted: 07 December 2017 at 6:37pm | IP Logged Quote BrianP

In my experience with Windows & USB I find that periodically I need to go into device manager - show hidden devices & delete all the ghost entries for USB devices. I think Windows just runs out of space - buffer overflow?
I also delete any ghost disk drives & storage devices. Seems then to work fine (until next time).

B
Back to Top View BrianP's Profile Search for other posts by BrianP
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 362
Posted: 07 December 2017 at 7:21pm | IP Logged Quote CaptainBoing

Grogster wrote:
So long as you stick to a certain USB port physically, the COM port number SHOULD stay the same. Note I said 'Should'..... Windows does odd things.


this is why I have moved away from putting USB<->Serial thingies in every project - unless there is a definite need for it. I had millions of COM ports simply because I had moved devices between usb ports on hubs etc and each time Windows made a new com port for the same device in a different port... this is down to how the USB interface reports itself as mentioned above - if it is strictly compliant then windows will recognize the same device but cheapie CH340G's from ebay, while a bargain and they "just work" are obviously dirty coded.

What I do now is to equip most projects with a 3.5mm jack and take the console to that, they usb interface is now on the cable from the PC (which has a 3.5mm plug). this also gives me lots of options on connections from a direct USB/serial cable, a USB/HC12 pod thingy etc... is saves 1 per device and stops my laptop getting dirty with loads of com ports and expands the possibilities of the console - including sending logging to serial printers.

http://www.fruitoftheshed.com/Circuit%20Ideas.Simple-Serial-Console-Connection.ashx

Edited by CaptainBoing on 07 December 2017 at 7:24pm
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
robert.rozee
Guru
Guru


Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 1185
Posted: 07 December 2017 at 8:51pm | IP Logged Quote robert.rozee

Quote:
... are obviously dirty coded.


that might be a little extreme - there are simply two different approaches, both of which are quite valid and legitimate.

imagine having 20 or more identical devices you regularly plug into, only ever one at a time, and each one grabbing a new comm port name. it would be an absolute nightmare. whereas, if each one popped up as the same comm port name, life would be considerably simpler.

i do suspect that if presented with the two options, a majority (though not all) of folks would wish all their usb/serial devices to appear under the same comm port name, or under a small group of names.


cheers,
rob :-)
Back to Top View robert.rozee's Profile Search for other posts by robert.rozee
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 362
Posted: 07 December 2017 at 11:14pm | IP Logged Quote CaptainBoing

Hi Rob. I do take your point but I suppose I should clarify that a bit: I have 17 CH340G scattered around, all purchased over a period of time... all have the same ID and serial values - they are quite literally clones. Hence my PCs don't stand a chance of keeping track of them and when I present the same device to a different USB port, It gets a new COM port assignment. As you point out above that can have advantages if you are doing one at a time or for specific users - it drive me mad to have "COM24" etc , I never knew if a combination of devices made project A COM4 or COM7 and there's a period of finding out most times when i connect.

If the coding on them had progressive/different serials (thus, with the mfctr & type etc. identifying a specific device) each would be assigned a com port and it would track regardless of which physical USB port it was plugged in... such serialisation requires work (=$$$) and evidently isn't done for whatever reason (and it might be just one offender) . That is quick and dirty in my book - BUT... I don't care because they are cheap as chips and do what they say. My hypocrisy goes to here. In further mitigation, I have developed my own techniques for USB<->serial comms which suits even better. This greatly simplifies field work because when I plug into a unit I*know* it is always on a the same com port, set up once forever and I don't have to change terminal settings or anything like that.

Horses for courses I guess

Edited by CaptainBoing on 08 December 2017 at 12:08am
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
robert.rozee
Guru
Guru


Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 1185
Posted: 08 December 2017 at 6:37am | IP Logged Quote robert.rozee

Quote:
Horses for courses I guess


very much so, and i do really like your idea of using 3.5mm sockets as a 'standard' for ttl serial interface.

btw, it is not that devices such as the CH340G all have the same serial number programmed into them, but rather that they have no serial number. to have a unique serial number a device needs somewhere to store it, and a means for the user (or chip manufacturer) to get it in there. or a pin or two dedicated to an external eeprom or 1-wire unique serial # chip like the DS2411:
https://www.maximintegrated.com/en/products/digital/memory-products/DS2411.html

with peter's 1455 code i vaguely recall us very briefly discussing unique id numbers, but it really would have been impractical to do in any sort of 'user friendly' way. the firmware would have needed to be able to rewrite a block of flash dedicated to the serial number, and there would have needed to be a protocol for communicating the serial number to it.

i suspect that in the case of the CH340G any internal firmware is on a masked rom, so there is not even the luxury of any flash to store a serial number in.


cheers,
rob :-)
Back to Top View robert.rozee's Profile Search for other posts by robert.rozee
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 2
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1040 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.1