[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] Wrong calibration ?
Jennings, Richard R wrote:
>
> Hello,
> I will try to help as I have been looking into a similar
> benchmark problem. Hopefully someone will correct me if
> I am wrong.
> In init_module():
> [1] you call rt_set_oneshot_mode() followed by
> start_rt_timer(). Since start_rt_timer() sets the
> timer mode back to periodic, rt_set_oneshot_mode()
> does you no good.
Start_rt_timer does not change the timer mode.
> [2] I think here is the real problem. The call to
> start_rt_timer() has a value LARGER than the
> call to rt_task_make_periodic(). I believe the
> value for rt_task_make_periodic() must be a
> multiple of the value in start_rt_timer(). Try
> defining TICK_PERIOD to 700000 or 700000 divided
> by some whole number and I think you will see the
> bad jitter go away.
In oneshot mode the period used in start_rt_timer has no meaning. It
must be there just because there is a single function to start it. In
oneshot mode you can even use 0.
> Maybe Paolo or someone else can shed more light.
> Are there recommended min and max values for the call
> to start_rt_timer() for 8254? APIC?
There is no recomended value, it depends on the machine you are using
and it is of any meaning just in periodic mode. In such a mode it does
not make much difference between 8254 and APIC timer and you should use
just the time ticking you strictly need, to avoid too much overhead.
Recall that in periodic mode the period set in start_rt_timer is the
smaller unit with which you can count time.
The problem reported by Sebastien is strange as there is already the
calibration examples in RTAI that does the same thing and has no drift
at all.
I'll look at it when I can find a bit of time for recompiling and
executing.
Ciao, Paolo.