Subject:
|
Re: Timing of RCX statements
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Tue, 24 Oct 2000 03:27:18 GMT
|
Viewed:
|
2058 times
|
| |
| |
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...
void tick_1()
{
static int sensor_phase=0;
static int tick_phase=0;
update_pwm(); // 1ms timebase for PWM outputs
if (++sensor_phase == 3)
{
sensor_phase=0;
sample_sensors(); // 3ms sensor sampling
}
if (++tick_phase == 10)
{
tick_phase = 0;
tick_10(); // 10ms system tick
}
}
void tick_10()
{
static int timer_phase = 0;
wakeup_tasks();
if (++timer_phase == 10)
{
timer_phase = 0;
update_timers(); // provides 100ms resolution timers
}
}
I'm betting that task scheduling (at least from wait to running) happens
on 10ms boundaries. Depending on how they wrote the code, it would
either round up or down when you wait for 10ms but start the wait in the
middle of a 10ms slice. Your experiement suggests they round down.
All of this is just speculation, though. If you need an exact answer,
I'd start eith Kekoa's listings of the ROM and firwmware and try to
trace the timer routines.
Dave
--
reply to: dbaum at enteract dot com
|
|
Message has 1 Reply: | | Re: Timing of RCX statements
|
| (...) 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 (...) (24 years ago, 24-Oct-00, to lugnet.robotics.rcx.nqc)
|
Message is in Reply To:
| | Timing of RCX statements
|
| I was trying to simulate a serial link by using an output of the RCX. I didn't work and when I analyzed the timing, I found out that the RCX's execution of statements is far too slow for the protocol I wanted to simulate. So I made some measurements (...) (24 years ago, 23-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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|