From: Wolfgang Grandegger <wg@grandegger.com>
To: "Mauricio �" <maray@inf.utfsm.cl>
Cc: mgross <640e9920@gmail.com>, linux-rt-users@vger.kernel.org
Subject: Re: RT_PREEMPT and Serial Port
Date: Sun, 13 Apr 2008 19:37:47 +0200 [thread overview]
Message-ID: <480244EB.90303@grandegger.com> (raw)
In-Reply-To: <20080412233428.GA4261@alumnos.inf.utfsm.cl>
Mauricio � wrote:
> On Sat, Apr 12, 2008 at 01:08:37PM -0700, mgross wrote:
>> On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
>>> Hi all,
>>>
>>> I've been searching on the web (and in the rt-wiki) for the current
>>> status of the real-time support for devices. For instance
>>> the serial port, CAN Bus, etc.
>>>
> [...]
>
>> FWIW I was able to get +/- 30usec jitter from a serial port experiment
>> where I programmed a PIC to push 5 bytes over the serial line every
>> 20ms.
> My results are similar. A 30 usec jitter it seems to be the limit,
> but indeed the jitter is less, because the latency is near the
> 10 usec. But, that is "on average", because I've run several
> test during long time periods, and my worst jitter is like 5 msec!,
> which is too much. Maybe it is a hardware problem, but I am using
> no swap, no usb and no DMA, and I dont know which other thing
> i should disable to not have this huge random jitter.
> (Obviosly I am locking the memory to have no paging)
>
>> I had a blocking read from a FIFO pthread that would wake up
>> and call gettimeofday, which I used to measure the jitter.
>
> I have the same idea, but using clock_gettime which use timespec
> (nanoseconds) like nanosleep.
>
>> It was
>> very impressive. I'm pretty confident that *if* you use a hardware
>> serial port (no-USB) you will be able to implement effective PID
>> controls with a real time pthread program running on a RT-preempt
>> kernel.
>
> In summary, i am reading from other computer the data sent by a serial
> port, and almost always I have a 30-40 usec jitter, but sometimes
> I get a single point where the jitter is like 1-5 msec. The strange
> thing is that the sender shows perfect timing (less that 30 usec),
> but the reader get these strange jumps. I am downloading the last
> kernel to check the serial port driver code: the patch -rt do something
> with the serial port? or generally some hardware related pacth?
Just to be sure, the interrupt thread of your serial port is running at
a higher priority than the others.
Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-04-13 17:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-04 7:57 RT_PREEMPT and Serial Port Mauricio A. Araya L�pez
2008-04-04 15:42 ` Nelson Castillo
2008-04-12 20:08 ` mgross
2008-04-12 23:34 ` Mauricio A. Araya L�pez
2008-04-13 17:37 ` Wolfgang Grandegger [this message]
2008-04-13 20:54 ` Mauricio A. Araya L�pez
2008-04-13 18:00 ` mgross
2008-04-13 18:56 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=480244EB.90303@grandegger.com \
--to=wg@grandegger.com \
--cc=640e9920@gmail.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=maray@inf.utfsm.cl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.