A simple USB question

Hi! I have an AT91SAM7S-EK kit with an AT91SAM7S256 microcontroller. This microcontroller supports 4 Endpoints - EP0, EP1, EP2 and EP3. I am using the USB to communicate with a legacy application running on the PC. This application can only communicate on a COM port. So, I use the USB to provide a virtual COM port on the PC with which this application can communicate. My question is - Can I create more than 1 virtual COM port on the PC with 1 USB connection?

Reply to
vasu
Loading thread data ...

Op Wed, 06 Jun 2007 13:56:00 +0200 schreef vasu :

If your legacy driver can only recognize a single COM port per USB device, you could create a 'compound device', which acts to the outside as a USB-hub.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

Snip:

connection?

Any easy solution would be to but yourself a USB hub. And if you are really interested to make virtual com ports over a single USB then its subject to OS that you are using there. In windows (ms) world it sounds like a virtual driver to me or strictly speaking an upper level filter for USB stack.

ali

Reply to
Ali

Le Wed, 06 Jun 2007 16:00:37 +0200, Boudewijn Dijkstra a écrit:

what about a composite device with 2 COM ports? Is it possible?

Reply to
Mouarf

Op Wed, 06 Jun 2007 16:12:23 +0200 schreef Mouarf :

compound == composite

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

Multiple endpoints allow for multiple "logical channels" inside a single USB device, (with endpoint 0 reserved as the control channel,) so the answer is no, unless you develop your own drivers on both ends of the USB connection, to

(a) Create multiple virtual COM ports on the PC/Host side.

(b) Multiplex the data streams from the ports in (a) using one or more of the remaining USB endpoints.

(c) Demultiplex those streams on the embedded/Guest side.

Only a USB hub can connect more than one device to a single USB host port, so another possibility is to include a hub in your design, as another poster mentioned.

If you have a few weeks of spare time here is some reading material:

formatting link
formatting link
formatting link

Books: Jan Axelson's "USB complete" and Hyde/Intel's "USB design by example" are good references, although not up to date.

Roberto Waltman

[ Please reply to the group, return address is invalid ]
Reply to
Roberto Waltman

Le Wed, 06 Jun 2007 16:43:29 +0200, Boudewijn Dijkstra a écrit:

I've read in "USB Complete" that compound=1 device + hub and composite=1 device with multiple functions I may have badly understood

Reply to
Mouarf

Op Fri, 08 Jun 2007 10:31:06 +0200 schreef Mouarf :

My copy of the USB 2.0 standard says: "However, a physical package may implement multiple functions and an embedded hub with a single USB cable. This is known as a compound device." and "From the host's perspective, a compound device is the same as a separate hub with multiple functions attached."

So my "==" signifies an equality in behaviour as observed by the host. Which is the only thing that matters here, IMHO.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

Op Fri, 08 Jun 2007 10:55:10 +0200 schreef Boudewijn Dijkstra :

Sorry for the confusion. The complete paragraph in section 5.2.3 reads: "Multiple functions[1] may be packaged together in what appears to be a single physical device. For example, a keyboard and a trackball might be combined in a single package. Inside the package, the individual functions are permanently attached to a hub and it is the internal hub that is connected to the USB. When multiple functions are combined with a hub in a single package, they are referred to as a compound device. The hub and each function attached to the hub within the compound device is assigned its own device address. A device that has multiple interfaces[2] controlled independently of each other is referred to as a composite device. A composite device has only a single device address. From the host?s perspective, a compound device is the same as a separate hub with multiple functions attached. Figure 5-5 also illustrates a compound device."

Note that this is the only paragraph in the standard where composite devices are mentioned.

And from the Terms and Abbreviations: [1] "Function = A USB device that provides a capability to the host, such as an ISDN connection, a digital microphone, or speakers." [2] "Interface" is not defined in the Terms and Abbreviations.

So compound != composite.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

Le Fri, 08 Jun 2007 11:35:37 +0200, Boudewijn Dijkstra a écrit:

thanks for having a look at the usb spec! I did finally not badly understood the difference between composite and compound but I have to admit that the vocabulary in standards is quite borring. Using new words to define something not described in the standard adds confusion in minds. I will in the next weeks implement a composite device firmware and I still don't know exactly how to separate the multiple functions during enumeration process.

Reply to
Mouarf

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.