home *** CD-ROM | disk | FTP | other *** search
-
- StopWatch V2.0 by Christian Danner 23/02/91
-
- DOCUMENTATION
- =============
-
- PRINCIPLES
-
- "StopWatch" is a stop watch application, which makes a programmable precision
- of more than the by the system time offered 1/50 second possible (with a
- standard Amiga 500/1000/2000 e.g. a resolution of one millisecond occupies
- only little processor time, with a turbo board this value can furthermore be
- increased).
-
- The program reacts on the status of the joystick button, that means
- connecting Pin 6 with Pin 8 of the joystick plug triggers the timer.
- It gets its timebase from the CIA B timer A and in the last resort from the
- 7.16 MHz system frequency via interrupt programming. After many - by reason
- of inaccuracy - frustrating experiments with the CIA A timer A, which ought
- to be the only one available for free access according to the Addison Wesley
- Hardware Manual and other publications, I used this pretendedly by EXEC
- continuously occupated timer. Til now no incompatibilities occured. The
- interrupt priority level 6 prevents the timer program from being overrun by
- other interrupts and guarantees a high degree of precision.
-
- I tested the program on different conditions. During car races I'm using it
- in the background, where the input data come from a hardware interface
- producing a short circuit to the according joystick port wires when the time
- measurement beam of a light barrier is interrupted. At the same time a
- Superbase application is running on this machine, doing IO with another Amiga
- via the serial device for displaying the score lists and serving a printer
- connected to the parallel port. In comparison with a professional stop watch
- running simultaneously, I couldn't find out any difference in the resulting
- times. Corresponding to my tests, normal Intuition interfacing, file handling
- etc. might not corrupt the timer. So far I only found one program, a sound
- generator, which caused deviations.
-
-
- FEATURES
-
- The program displays the single lap times and the total times in a window
- on the Workbench screen. You can determine the number of laps per race and
- the period of time, where no incoming signal is processed after a valid
- event. In an uncomplicated manner you can adjust the measurement on your
- equipment (I have not yet tested, whether it's necessary or not, but it might
- be required depending on the quartz base). Optionally for the purpose of
- transmitting the results to other applications, the data can be saved to a
- disk file in ASCII-format. You can specify the filename freely, a selection
- between only saving total times or saving all lap-times is possible, just as
- you can choose whether the file only has to contain the last time or a time
- list shall be generated. Also an ARexx-port for remote control with parameter
- modification and a more comfortable result handling is implemented.
-
-
- CALIBRATION
-
- First You have to select the resolution of the timer, which means
- the frequency of timer incrementation (e.g. 1000 for a resolution of
- 1/1000 second). This value should not be excessively high, because You can
- slow down the system rapidely by the timer interrupts.
-
- Now You have to tune the timer by changing the VIACYCL-Values ("VIA-Cycles/
- Timercycle" in the Workbench window), so that the resulting times are mostly
- valid in comparison with another stopwatch. Doing this, the "Correction-
- factor" has to be 0.
-
- For a fine adjustment a correction factor can be defined, which is equivalent
- to the time deviation devided by the total period of time where it occured.
- To be able to supervise this adjustment, the resulting correction value is
- displayed in terms of milliseconds with every measurement in the last of the
- three columns.
-
-
- PARAMETERS
-
- All the parameters can be transmitted to the program when starting it. I have
- implemented certain commands for the startup from the CLI, ToolTypes for
- running "StopWatch" from the WorkBench and Rexx-commands to influence the
- already started application.
-
- ToolType CLI PrgWindow Explanation
- ---------------------------------------------------------------------------
- LAPS=number -l.. Number of Laps number of laps per race
- REFRACT=number -r.. Refract.-Time refraction after a pass
- CYCLSEC=number -s.. Resolution number of timercycles per second
- CORRECT=±number -c.. Correctionfactor timer fine tuning factor [* 1E-6]
- VIACYCL=number -v.. VIA-Cycles / Ti. coarse tuning of the timer
- DISPLAY=number -d not implemented number of result lines in display
- FILE=path/filename -f.. not implemented filename for saving the results
- APPEND=ON -a not implemented generate result-list
- PASS=ON -p not implemented save also lap-times
-
- Valid data range: LAPS 1 .. 99999
- REFRACT 1 .. 99999
- CYCLSEC 1 .. 50000
- CORRECT -9999 .. 99999
- VIACYCL 50 .. 10000
- DISPLAY 2 .. 12
-
- Note: A VIACYCL-value < 150 may freeze a system without accelerator card by
- occupancy of a great amount of calculating time for handling the
- timer interrupts! You could check this with a performance monitor.
-
- Example for CLI-Startup:
- StopWatch -l2 -r500 -s1000 -v708 -c-525 -fCLIPS:TimeList -p -a -d5
-
- To modify the parameters in the Workbench window you first have to click on
- the "STATE"-button or to select the pulldown menu "Project/Parameters". Then
- a modification of the values in the parameter field is possible. When done
- click on the same button again. This sets the new values and zeroes the
- timer.
- A reset also can be processed simply by selecting the according pulldown
- menu.
- The state of the system is displayed in an area above the "STATE"-Button.
-
-
- REXX-COMMANDS
-
- The ARexx-port of "StopWatch" can be accessed via its name "RexxStopWatch".
-
- So far the following commands are implemented:
- CLOSE, RESET, GETTOTAL, GETLAP, GETSINGLE,
- LAPS, REFRACT, CYCLSEC, CORRECT, VIACYCL.
-
- CLOSE ends the program.
- RESET resets the timer.
- GETTOTAL transmits the next total time.
- GETLAP transmits the next additive lap time.
- GETSINGLE transmits the next single lap time.
-
- The purpose of the other commands to modify the parameters is already
- described.
-
- The abortion of GETTOTAL, GETLAP or GETSINGLE with "Abort RexxCmd" returns an
- error level 10 in RC.
-
- Example:
- /* RexxStopWatch */
- ADDRESS COMMAND "Run StopWatch -d10" /* Starting StopWatch */
- ADDRESS COMMAND "Wait 2 Sec"
- ADDRESS "RexxStopWatch" /* Selection of the Rexx-port */
- OPTIONS RESULTS
- LAPS 4 /* Modifying the parameters */
- VIACYCL 708 /* coarse tuning */
- CORRECT "-525" /* fine tuning */
- CYCLSEC 1000 /* resolution 1/1000 sec. */
- REFRACT 500 /* refraction 500 * resolution */
- GETLAP /* Get next additive lap time */
- IF RC = 0 THEN
- SAY "LAP : "RESULT
- ELSE
- SAY "ERROR: "RC
- GETLAP /* Get next additive lap time */
- IF RC = 0 THEN
- SAY "LAP : "RESULT
- ELSE
- SAY "ERROR: "RC
- RESET /* A reset of the timer */
- GETSINGLE /* Get next single lap time */
- IF RC = 0 THEN
- SAY "SINGL: "RESULT
- ELSE
- SAY "ERROR: "RC
- GETSINGLE /* Get next single lap time */
- IF RC = 0 THEN
- SAY "SINGL: "RESULT
- ELSE
- SAY "ERROR: "RC
- LAPS 2 /* Modifying laps per race, reset */
- GETTOTAL /* Get next total time */
- IF RC = 0 THEN
- SAY "TOTAL: "RESULT
- ELSE
- SAY "ERROR: "RC
- CLOSE /* Ending the program */
- EXIT
-
-
- IMPLEMENTATION
-
- Most of the code is written in M2Amiga Modula 2 V3.1d (really antique
- version) by AMSoft. I have implemented the interrupt routines in assembler
- using the Data Becker Profimat-Assembler (may be there are better ones).
- Thanks to CygnusSoft for their excellent editor, which helped me to keep the
- source together.
- This release already supports different Workbench fonts. Thus I hope, it will
- run correctly under AmigaDOS 2.0.
-
-
- COPYRIGHT
-
- Copyright (c) 1991 by Christian Danner. This program may only be distributed
- on non-commercial base together with this documentation file. It may not be
- distibuted on commercial base without my explicit permission. When you use
- this program most frequently, especially in a professional manner, I won't
- refuse a little fee.
-
- For further improvements please let me know of all the bugs you find and all
- the options you miss.
-
-
- My address: Christian Danner
- Rißkopfstraße 10
- 8106 Oberau
- Germany
- Phone: 08824/8122
-