Subject:
|
Re: Timing of RCX statements
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Tue, 24 Oct 2000 08:49:58 GMT
|
Viewed:
|
2120 times
|
| |
| |
In lugnet.robotics.rcx.nqc, Dave Baum writes:
> In article <G2vur8.B05@lugnet.com>, "Bernd Frassek"
> <bernd.frassek@aachen.utimaco.de> wrote:
>
>
> > When I tested
> >
> > On (OUT_B);
> > Wait (1); /* 10 ms delay */
> >
> > The result was between 10 and 11 ms. I expected approx. 14 ms.
>
>
> I wouldn't expect Wait() to be very precise. I haven't looked at the
> firmware in great detail, but generally when writing this sort of thing
> you set up timing chains. Imagine a function that gets called every 1ms
> for bookkeeping...
Thanky Dave for your reflections concerning the timing. The thing that caused
some astonishment and a little bit of frustration is that the RCX is so slow.
O.K. - the code sent to the RCX is interpreted and this needs some time.
However, I was glad that there are "FastTimers" (10 ms ticks) now and that this
would give me better resolution (e.g. for simulating a protocol). But then I
discovered that for a timer (e.g. timer 1) the following statement will not
perform a wait of e.g. 30 ms:
until (FastTimer(1) == 3);
In fact, the checking of the condition needs something around 3 .. 4 ms. As a
result of this, the condition won't become true. Of course you can use a ">="
but then you will create waits of 31 to 34 ms.
The above statement will work when the number of 10 ms ticks is >= 10. Funny,
that
until (Timer(1) == 1);
works always.
The whole subject may seem to be "very academic" to other readers. I will soon
post some lines for an "electrical link between two RCX" so that it will become
clear why I wondered about timing.
Bernd
|
|
Message is in Reply To:
| | Re: Timing of RCX statements
|
| (...) I wouldn't expect Wait() to be very precise. I haven't looked at the firmware in great detail, but generally when writing this sort of thing you set up timing chains. Imagine a function that gets called every 1ms for bookkeeping... void (...) (24 years ago, 24-Oct-00, to lugnet.robotics.rcx.nqc)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|