autox
[Top] [All Lists]

Re: Autocross Timing/Scoring Software

To: autox@autox.team.net
Subject: Re: Autocross Timing/Scoring Software
From: gpsoftware <gpsoftware@icehouse.net>
Date: Thu, 30 Sep 1999 16:31:20 +0000 (GMT)
Wow, way more interest in this subject than i thought possible!

A lot of the negatives about timing with a PC has focused on using the 
serial port (set up to do RS-232 communications) as the trigger input device,
and the fact that it isn't one of the higher priority interrupts. This is 
true, and if you use this technique the interrupt latency is not really 
consistant. You have to take control of the PC hardware.

Accucros doesn't do this. The technique involves re-programming the
counter/timer hardware (interrupt 0, the highest priority) and inserting
it's own interrupt routine that then "polls" the hardware port that the
triggers are connected to. This can be the serial, parallel, game, keyboard,
or whatever hardware port you wish. RS-232 protocol has nothing to do with
it.

This "polling" is done at around 2300 times per second. If you use a polling
method you must poll at twice the rate of your desired accuracy. The 2300
number was a convenient multiple to use so the regular interrupt routines
could be called at the same intervals as normal without any jitter. The 
timing part of the program is not relient on processor speed. A timestamp
is taken and placed in a buffer that gets read by the non-realtime part
of the software at it's leasure. You also need an OS that allows this level 
of hardware access, such as DOS or Windoze95/98 in DOS mode.

If you really wanted to you could load some strange TSR or driver that would
hold off interrupts long enough to miss polling the port. I've heard that
network drivers and disk compression software can do this. The solution
is simple: boot clean, only the mouse driver is needed.

I have verified this two ways. I have used a single trigger to start the
system and a stopwatch (funny how some think a PC won't time, but a $10
stopwatch is OK). I compared times of short and long duration and made sure
the percent of error was equal in all cases. I also wrote test code that
outputs a signal to the parallel port whenever the program was inside the
interrupt poll routine. I connected this signal to a HP logic analyzer and
make sure the data stream was coming out at the correct rate (~2300 per 
second). I performed functions like printing, disk access, data editing, 
and the data stream rate never changed. Also, I did this test on a 8088 based
computer.

The absolute timing will be slightly different from PC to PC. This is
totally irrelevant to Autocrossing since the course design always changes,
and other factors (like the sun going behing a cloud) has a much higher
contribution to error than the error in a PC oscillator would have.

Gary Poole
Accucros Autocross Software by GPSoftware
gpsoftware@icehouse.net
www.icehouse.net/gpsoftware

 ---> WebMail/Java  v0.5.4 HTML<->Mail Gateway <---


<Prev in Thread] Current Thread [Next in Thread>