Why is the serial port so slow in Linux?
- From: Richard <rkm@xxxxxxxxxx>
- Date: Sat, 03 Feb 2007 20:06:17 -0500
I am doing a loop-back test with the serial
port, I have connected pins 2 and 3 (the
transmit and receive pins) on the DB9
connector together. I am sending a series
of single bytes and reading them back as
soon as they are available. The program
works, the only problem is that the time
it takes to transmit and receive the
bytes is about 30 times longer than for
a DOS program I wrote that does the same
thing.
A long while ago I posted in a Linux
newsgroup asking why the serial port is
so slow in Linux, and I got a reply that
the problem is the FIFO in the UART. The
explanation given was that the UART waits
until the fIFO is filled up before it
interrupts the CPU, so if you are just
transmitting single bytes the serial driver
is timing out waiting for the bytes to be
echoed. I was told that the thing to do
was to disable the FIFO in the UART.
I have tried to figure out how to
disable the FIFO. I did a search and
found some posts that say you can disable
the FIFO by re-assigning the UART type
to an earlier one which did not have a
FIFO, for example as follows:
setserial /dev/ttyS0 uart 16550
(rather than 16550A). I also tried setting
the UART type to 8250. However, none of
the re-assignments of UART type have had
any effect on the speed of the serial port.
Can anyone tell me how to disable the FIFO,
or is there some other problem or setting
I need to be aware of? I don't understand
why the serial port would be so much
slower under Linux than DOS.
Thanks,
Richard
.
- Follow-Ups:
- Re: Why is the serial port so slow in Linux?
- From: Floyd L. Davidson
- Re: Why is the serial port so slow in Linux?
- From: The Natural Philosopher
- Re: Why is the serial port so slow in Linux?
- Prev by Date: Re: open source copyright
- Next by Date: Network backup options
- Previous by thread: Network card for Dell XPS 410 and RedHat
- Next by thread: Re: Why is the serial port so slow in Linux?
- Index(es):
Relevant Pages
|