Emulate two serial ports through the USB connection (Teensy 3.2)

Status
Not open for further replies.

someteen

Well-known member
I'm working on a project (Teensy 3.2) where I need to communicate with two separate apps (different protocols) installed on the same PC.

Is it possible to emulate a second virtual COM port through the USB connection?
 
I thought it was a stupid question but, after reading about some implementations using a much slower CPU (Xmega 128A4U) I guess it should be doable.
Any clues on this matter? Thank you very much for your time.
 
I'm kind of surprised that no one has done it yet (Teensy/Arduino world).
I need no mapping to physical (GPIO) pins - so no bit banging. I just need one more pair of (virtual) UART registers to set up an extra (low baud rate: 9600) serial connection through the same USB port.
 
If this were done, which operating system would you expect to be supported?

Windows XP, 7 and 8 are the problematic ones...
 
Why not just run 2 uarts separately through USB converters, better yet, use the same UART and dynamically change baudrate, over a single usb to uart adaptor

Serial1.begin(115200);
//Do Something...
Serial1.begin(9600);
//Do Something Else...

If you are looking to split the same Com port data, look into Xport, used to use that back in the carPC days when gps was being shared with frontend software's spedometer
 
That would be really great for debugging apps which have their normal communication channel (commands, data etc) to the PC via Serial. For those apps I usually connect a a USB/Serial cable to one of the hardware uarts to spit out debug messages which is kind of tedious (but of course possible). I'd like that for Win10.
 
According to this blog post (three serial ports at the same time):

The STM32 has three UARTs, so how about a USB to three serial ports? [..] Map each of the serials to a virtual serial port over USB using a composite device.

I know it's a different MCU but I think the whole theory could apply to any ARM (M4) processor. Although I've read that article for many times, I have no clue of what or where to insert an additional code into Teensy core files to implement that stuff.

Anyway, it seems not to emulate some virtual UARTs (registry) from scratch but "tunneling" the existing hardware UARTs through that USB connection (CDC/ACM class).
 
Status
Not open for further replies.
Back
Top