8xx SCC and SMC uart latency

Wolfgang Denk wd at denx.de
Tue Jan 14 02:14:18 EST 2003


Dear Eli,

in message <75DF04AC5ED4D511A9810090273CB4163A66F0 at ROKONET-E> you wrote:
>
> We have a device that communicates over RS232 at 9600 bps.  This device has
> a 4 mSec timeout, i.e we have to reply in less then 4mSec.

Which parts of your software are included in this timeout?

Do you mean something like that:

* driver receives data
* application reads data from driver
* application generates response
* application writes response to driver
* driver sends data

?

> The packets are usually small (4-6 Bytes).  We communicate successfully with
> the device, but only if we change the timeout to above 10mSec.
> It seems that it takes 5-8 mSec for us to reply.  This is the same if we use

You might try to run your code with LTT instrumentation so  that  you
can  see  where  it  takes  the  time.  I  guess  it's just that your
application takes that long before it gets scheduled.

> SMC or SCC.  We tried to play with the MAX_IDL and the Tx/Rx buffer sized,
> but with no success.
>
> Has anyone an idea on how to minimize the uart latency?

I don't think that this has anything to do with the UART driver.

> If we use the same code on a PC (i386) we reply in 300 microSec.

If you have to guarantee a response time, you will have  to  consider
using a real-time extension like RTAI. The standard Linux kernel does
not guarantee any latencies.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
You can love it, change it, or leave it.    There is NO other option.
But do not complain - it is your own choice...                  -- wd

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list