All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andrey Nechypurenko <andreynech@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] PWM generation with GPIO
Date: Tue, 06 Sep 2011 09:29:19 +0200	[thread overview]
Message-ID: <4E65CBCF.7020600@domain.hid> (raw)
In-Reply-To: <CAOiXNkC3qdOLEwZUWciaGpKNjsgP+RBkDzG1gMQ2jY2-MSfvvg@domain.hid>

On 09/05/2011 10:14 PM, Andrey Nechypurenko wrote:
>> The best way to know if what you observe is due to the natural jitter or
>> to some other issue is to measure the jitter at the point where you
>> think it is.
> 
> Since the generation loop is so simple I was assuming (maybe too
> naive) that this is exactly where it starts to deviate from the ideal
> timing. But you are right - more precise measurements are required and
> I will definitely try to do it.
> 
>> But, anyway, such low level code would be best implemented
>> in a driver, completely in kernel-space, that would reduce the jitter,
>> an ioctl allowing to configure the duty cycle.
> 
> I was trying to stay in the user space as long as possible :-) .
> Please correct me if I am wrong here, but I was thinking that Xenomai
> actually runs Linux kernel as one of it's tasks (acting as a kind of
> supervisor). As a result, kernel could be preempted whenever Xenomai
> finds it necessary so the real-time performance of the Xenomai task
> (thread?) might be even better then kernel driver. Am I wrong with
> this assumption?
> 
> In addition, by any chances, maybe you have some figures to estimate
> the jitter values which might be realistic to achieve using
> driver-based approach you suggested? Would you expect these figures to
> be considerably better then what I was observing with Xenomai-based
> implementation?

Of course, Linux drivers may be preempted by Xenomai. I was talking
about a Xenomai driver, using the RTDM skin using for instance two
timers, a periodic timer which handler would set the gpio to 1 and
launch the second timer, a one shot time which handler would set the
gpio to 0.

To estimate the jitter of code executed in the timer handler, use
latency -t 2. Note that for latency -t 2 to work, you need to enable the
corresponding driver in the kernel configuration (Real-time
sub-system/drivers/testing/timer benchmark driver).

Regards.

-- 
                                                                Gilles.


  reply	other threads:[~2011-09-06  7:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 19:53 [Xenomai-help] PWM generation with GPIO Andrey Nechypurenko
2011-09-05 20:02 ` Gilles Chanteperdrix
2011-09-05 20:14   ` Andrey Nechypurenko
2011-09-06  7:29     ` Gilles Chanteperdrix [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-08  2:03 Bob Feretich
2011-09-08  8:21 ` Andrey Nechypurenko
2011-09-08  9:13   ` Gilles Chanteperdrix
     [not found]     ` <CAOiXNkBjaSMRt1GO51hQUrU52PjQHZB9SfJXZzmAx72sYzyfMw@domain.hid>
2011-09-08 10:06       ` Gilles Chanteperdrix
2011-09-08 10:20         ` Philippe Gerum
2011-09-09  3:33     ` Bob Feretich
2011-09-09 11:41       ` Gilles Chanteperdrix

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=4E65CBCF.7020600@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=andreynech@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.