Main Site Documentation

Multiple virtual com ports on USB for Panda?


I have an application where I need to have a PC talk to the TTL level serial port on a device (call it X) and also be able to have the PC send commands to a Panda (or something) that can trigger digital I/O ports on the device X as well. What I want is to connect a Panda to the serial port of X and connect a few other pins to digital I/O on X and then be able to see the serial port on the USB com port and be able to send commands to the Panda over USB.

Getting the serial port across is no problem - just read the serial port and write to usb; read the usb and write to the serial port. Just pass the data through. Open a com port on the PC to the CDC device on the Panda.

But for the command channel from the PC to the Panda, I could use some type of “escaped” commands in the serial data stream, or I could talk to a different CDC device on the Panda over the same USB connection. That would be my preference.

So, does the Panda or another FEZ have the ability to be more than one CDC com port at the same time. I bet it does :slight_smile: Can some one point me at the APIs I will need? Thanks.

A bit more background: I have a bunch of devices (all the same in row on row of test benches) and I need to be able to talk to the serial port and use the digital I/O to hard reset or set configuration bits as if they were jumpers. My existing solution is a PIC based board with 2 serial ports - one is a pass-through that just does voltage level conversion to the device and the other is the command port for reset, etc. It is time for a new design that gets rid of the RS-232 ports. I want it to be freakin’ easy.


Of course, another thing I could do would be to hook up an Ethernet shield and use two sockets. But I want to keep the cost really low for some of these units. And the serial port has to run at 115K and I have not tested if the Ethernet shield will keep up when run by a FEZ.


I can answer the Ethernet part, With the new beta firmware you will get up to about 360Kbps speed on a TCP socket (only sending). So you probably will be able to achieve the 115Kbps.


It is 115200 baud but do you really have continuous data flow? Most applications don’t.

Running multiple devices on the same USB cable (composite device) is something we supported before but then was drooped due the many issues you will face on windows side, drivers…registry…etc. I highly not recommend going the composite USB route


OK, great. I will look for another solution.

And, yes, in this case, it may actually be sending a sustained data rate of up to 10K Bytes per second on that channel for periods of several minutes at a time. I encourage the developers not to spew that much on that channel, but sometimes it does happen.

I will pursue a sockets based solution.

Thanks so much.


On a side note, I tried to set up a multi CDC USB device in a PIC. I don’t know if my descriptors where correct, but the PC BSOD every time I plugged it in… ;D

I also read somewhere, if I remember correctly, that Windows’s CDC driver is supposed to support multi CDC devices but never has…

I needed it for application compatablilty. 1 USB cable to 2 RS232 ports(One for modem, one for barcode scanner) plus one CDC port for board control+status updates. If it was all on one port then there would have been problems as it is 3 applications that must talk to the 3 ports…


I created an abstracted UDP “sockets” over serial port, so you have seperate channels and can send/receive seperately over each. Works well. Still have the 115bps speed limit,