Electronic – the maximum number of bytes that can be sent through USB-to-serial COM port at one go

ftdiserialuart

Suppose someone uses hyper-terminal to send a very long ASCII string at a COM port. This COM port is created by FTDI USB-to-serial port cable. The cable used is http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232RG_CABLES.pdf.

Is there a limitation imposed by the UART driver for PC? For example, Arduino UART tx buffer is 64 bytes only.

What is the maximum number of bytes that can be sent through a PC serial port at one go?

Best Answer

In full-speed USB, the maximum packet size is 64 bytes.
In high-speed USB, the maximum packet size is 512 bytes.

Most USB/serial converters, including yours, use full speed.

However, if you are looking at the serial output, the USB packet size does not matter, because USB packets can be sent faster than the speed of the serial line, and are buffered. For example, if the PC sends 100 bytes, it will use two packets, but what you are seeing at the other end, on the serial line, is again a continuous stream of 100 bytes.

Similarly, if you are sending data from an Arduino, you can buffer a new TX byte as soon as some previous byte is being sent, so the size of the TX buffer does not really matter. (However, a larger buffer size allows the pre-buffer more data, which allows continuous transmission even if the microcontroller must do something else for a longer time.)

PCs, most microcontrollers, and USB/serial converters are fast enough so that the only bottleneck is the speed of the serial line, so you will never see a gap in the data, regardless of how many bytes are transmitted.