I've been working on a project where i communicate via serial with an Arduino Uno from a windows c# program. Everything works nice. When i invoke a command in windows, then I get a fast response from the uno..
I also have a Arduino Nano in my posession, but when i run the exact same code on that, the serial connection seem "slow", even though the settings are the same. When i invoke commands, the response takes a long time to return.
Does anyone have any idea what might slow/delay the serial connection??
Maybe the windows driver? The Nano uses an FTDI chip where the UNO has a ATmega16U2 programmed as a USB2Serial converter. They use different drivers (on my Linux box they appear as /dev/ttyUSBx [FTDI] or /dev/ttyACMx [16U2]) and it's possible that there is a difference. As the rest of the communication line is identical (ATmega328 at 16MHz) it's unlikely that this slows things down.
As you haven't showed us your code, this is the best guess I can give you.
In the windows program I send 20 packages every 1/4 second. Each package is two bytes. Before the next package can be sent the Arduino must first send a response, so:
windows program generates all 20 packages and stores them in a buffer, where a separate thread handles them..
When connected to the Uno, and by measuring with an oscilloscope on the Rx and Tx, the packages come in a cluster every 250ms, so no problem there.
but on the Nano, the Rx/Tx line is packed with data the entire time, and the buffer in windows keeps getting bigger (after a min or so over 2000 packages waiting). So something delays the packages from being sent. and it must be the waiting for a response.
I have checked the driver and tried to update it, but no change there..