# Tuning my USB COM port

## Recommended Posts

I have a system that has a sensor input running at 100 Hz, and 2 outputs that I would like to have running at 100 Hz each. All of this goes through a single USB port, to a USB hub. On the laptop, it resolves to each of these 3 lines pretending to be a separate COM port. Sensor input is 20kbps (25 bytes * 100 Hz), one output line is 77.6 kbps (97 bytes * 100 Hz), and the second output line is 23.2 kbps (29 bytes * 100 Hz), for a total of 120.8 kbps. All 3 COM ports are set to 115200 for their baud rate. The problem is that on these settings, the CPU clocks up to 100% after about 15 minutes which is obviously bad, then the system locks up eventually. I've ruled out memory leaks through repeat debugging sessions. It appears that it's backing up in the port and not writing fast enough. The input sensor seems fine as long as the outputs are brought way down or turned off. I'm using asynchronous winsock. My output has the following settings for timeouts:
ReadIntervalTimeout = 100;
WriteTotalTimeoutConstant = 10;
WriteTotalTimeoutMultiplier = 10;

Is there anything I can tweak to get better performance out of this? I'm kind of surprised that I'm only able to get a fraction of what I would expect moving in and out of the USB port. Are my timeouts wrong or something? Anyone better at serial communications than me able to give some settings suggestions? Thanks much -fel

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628402
• Total Posts
2982471

• 9
• 10
• 9
• 19
• 24