[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Serial Latency Issues, Baud Rate Affects Buffering



Eric,

You could send a continuous flow of bytes from the PC : 7 data bytes followed by
593 padding bytes. Then you synchronize your application on reading 600 bytes
and not on the clock. The buffer will be more stressed and maybe you will have
less problem ?




Eric Sorton wrote:

> Hi All,
>
> We have an ETRAX100LX development board.  For testing, serial port 2 on the
> ETRAX is connected to a PC via a null modem cable.  In the production system,
> a wireless modem (limited to 4800 baud) will sit between the PC and the
> ETRAX. At this time, we are operating the serial ports without hardware or
> software flow control.
>
> The PC runs a simple program which sends 7 bytes of data to the ETRAX via the
> Serial port at a rate of 50Hz (7 * 50 = 350 which is within the bandwidth
> capabilties of a 4800 baud modem).  Instrumentation in the PC program ensures
> that it sends the data at the proper rate and meets its timing deadlines.
>
> The ETRAX runs a simple application which loops at a rate of 50Hz.  Each
> iteration, the serial port is read.  Ideally, we would like to read 7 bytes
> of data each loop iteration.
>
> Initally, CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS was set to 5 and performance
> was poor.  On most iterations (at 115200 and 4800 and others) we would read 0
> bytes, when the buffer was finally flushed, we would read multiple 7 byte
> packets.  A bit research indicated that changing
> CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS to 0 or 1 would help the problem.
>
> With CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS set to 0, if we set the baud rate
> between the PC and the ETRAX to 115200, the ETRAX behaves well, and reads 7
> bytes each iteration.  If we set the baud rate between the PC and the ETRAX
> to 4800, the ETRAX behaves poorly and reads 0 bytes on some loop iterations
> while reading greater than 7 bytes on other loop iterations.  Why does the
> baud rate affect the behavior of the buffering?  Is there anything we can do
> to fix this issue?
>
> We also tried setting the CONFIG_ETRAX_SERIAL_FAST_TIMER and the
> CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST options.  This made the situation worse
> and NO data was transmitted between the PC and the ETRAX.
>
> With CONFIG_ETRAX_SERIAL_FAST_TIMER enabled, we were able to successfully
> transmit and receive 7 byte packets at 50Hz at 115200 baud.  When we tried to
> operate at 4800 baud, no data was received (a logic probe confirms the PC was
> transmitting data).
>
> With CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST, no data was recevied.
>
> Port 0 on the ETRAX is connected at 115200 to a different device.  We have
> seen no issues communicating with this device with any combination of
> options.  However, we do always run this port at 115200.
>
> We are looking for suggestions on what to try next as we are out of ideas.
> Any help would be greatly appreciated,
>
> Eric
>
> --
> Eric Sorton
> Senior Member Research Staff
> Institute for Scientific Research (ISR), Inc.
> 119 Roush Circle
> Industrial Park Road
> Fairmont, WV  26554
> Email: esorton@xxxxxxx.org
> URL: http://www.isrparc.org
> Voice: 304-368-9300 x219
> FAX: 304-534-4106