PDA

View Full Version : USB as a COM port vs. as a regular USB



jom
15th March 2014, 20:32
Hello

My description of my question isn't very clear I suppose but here goes. I've been working with Joe Salbia recently trying to get my 18F4550 PIC to work with his LED VB program. Here is his Wiki entry:

http://www.protonbasic.co.uk/content.php/4375-Controlling-8-LED-s-with-USB-and-VB

My question is what differences do I need in the PIC programming to get the PIC USB device to show up under "Universal Serial Bus" in the windows Device Manager rather than under Ports as a COM port? Or is the difference in the VB program in Windows? Or both??? The reason I ask is just for my edification as I really know very little about this USB business.

BTW, with Joe's help I did get my 18F4550 to work after fixing some flubs I had in the hardware. Thanks Joe!

jom

hadv215
20th March 2014, 14:31
Hi Jom,

the way Windows treats USB devices depends on the USB device, more precisely, the information in the descriptor file that was used for the device. But why would you want to change that?
If you want to learn about USB I would suggest you find yourself a copy of one of Jan Axelson's books "USB-Complete USB Complete - Everything You Need to Develop Custom USB Peripherals" or ""USB Complete - Develop Custom Peripherals". But mind you, it's pretty hard stuff.

jom
21st March 2014, 16:37
Hi Jom,

the way Windows treats USB devices depends on the USB device, more precisely, the information in the descriptor file that was used for the device. But why would you want to change that?
If you want to learn about USB I would suggest you find yourself a copy of one of Jan Axelson's books "USB-Complete USB Complete - Everything You Need to Develop Custom USB Peripherals" or ""USB Complete - Develop Custom Peripherals". But mind you, it's pretty hard stuff.

Change? No...I was just curious. I'm an RF engineer and I've been working with some test equipment and Eval boards recently that act differently when connected (via USB) to my PC. I have a PC driven Synthesizer that connects as a COM port and I have two Eval boards from some ADCs we are working with that connect as a USB and the other as a COM port. I was just curious as to why/how they are different.

Is there a compelling reason to go with a USB connected (as opposed to a COM port) set up? The ADC eval boards are running data through the USB to PC software that shows FFTs etc etc. Both are running at pretty fast rates so I'd guess the COM port connection runs just as fast as a USB connection but I'm not sure.

And, yes, I've looked at Axelson's stuff and it is VERY difficult...very similar to Zigbee, and WiFi and other "protocols" that seem (almost purposely so) very vague and abstract. Why that is I have no clue.

Thanks for any insight you can give.

jom

hadv215
21st March 2014, 18:02
Change? No...I was just curious. I'm an RF engineer and I've been working with some test equipment and Eval boards recently that act differently when connected (via USB) to my PC. I have a PC driven Synthesizer that connects as a COM port and I have two Eval boards from some ADCs we are working with that connect as a USB and the other as a COM port. I was just curious as to why/how they are different.

Is there a compelling reason to go with a USB connected (as opposed to a COM port) set up? The ADC eval boards are running data through the USB to PC software that shows FFTs etc etc. Both are running at pretty fast rates so I'd guess the COM port connection runs just as fast as a USB connection but I'm not sure.

And, yes, I've looked at Axelson's stuff and it is VERY difficult...very similar to Zigbee, and WiFi and other "protocols" that seem (almost purposely so) very vague and abstract. Why that is I have no clue.

Thanks for any insight you can give.

jom The fact that your synthesizer connects as a COM port may be caused by the fact that it has an internal USB<>RS232/TTL converter (like FTDI).
I think there are a number of reasons to use USB: speed, the lack of COM-ports on modern computers and, if there is that will be only 1.
Compare that to 255 USB devices

I agree that COM can go pretty fast, but with USB 3.0 (and versions to be coming in the future) speed can only increase.
Take a look at these numbers:


USB 2.0
480 Mbit/s
HighSpeed
2000



USB 3.0
4,8 Gbit/s
SuperSpeed
2008



USB 3.1

10 Gbit/s
SuperSpeed+
2013




The biggest drawback of USB is that only relatively short cables can be used.

Regards,
Harm

jom
22nd March 2014, 02:13
Synthesizer: Actually it doesn't. The USB input directly ties into an ATMEGA32U4 which I presume has some sort of USB module internally. This is similar to my set up using Joe's software I alluded to in my first post. I'm using a PIC 18F4550 (internal USB module) which also connects via a COM port. That is what led me to ask the question...since I also thought it should have connected like a USB instead of a COM port. So I presume that my set up connects via the COM port due to the CDC file I'm using and not because of anything to do with the Visual Basic interface?

Thanks!

jom

hadv215
23rd March 2014, 22:26
The PC software will never determine how a USB device operates, it's the other way around, you'll need PC software to communicate with that specific client.