home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
487.lha
/
Calibrate
/
Calibrate.doc
< prev
next >
Wrap
Text File
|
1991-03-11
|
13KB
|
276 lines
1 INTRODUCTION
Some Amiga 2000s have a problem: the battery backed up clock does not
keep accurate time (it is not uncommon for the clock to gain a minute
or two a day). This problem is easily fixed. The battery backed up
clock has an adjustment screw which allows you to adjust the clock
using a miniature screw driver.
The problem in adjusting the clock is that you need a reference source
to calibrate the clock against. Although you may have observed that
your clock runs fast or slow by some number of minutes each day, that
doesn't tell you how much you should turn the adjustment screw. If
you had access to the tools used to calibrate electronic watches you
would be able to tune your Amiga's clock without trouble. Since such
tools are rare, most people have had to resort to trial and error to
calibrate their Amiga's clock.
I have provided an alternative to trial and error: I have written a
program that compares the battery backed up clock against an
independent timer in the Amiga that is based on the alternating
current that powers your Amiga 2000.
The Amiga has several timers in addition to the battery backed up
clock. One of these timers is a line frequency clock that "ticks"
every time the alternating current completes a cycle (that is it ticks
60 times a second for North America and 50 times a second for Europe).
My program, called Calibrate, checks the time of the battery backed up
clock against the line frequency clock every ten seconds and displays
the results. This gives you almost instant feedback which allows you
to adjust the battery backed up clock much more accurately.
The Calibrate program can be used either from the Workbench or the
CLI. It can be used if your Amiga's power source is 60 cycles per
second or 50 cycles per second. The only tools you need are a medium
Phillips head screwdriver (in order to open your Amiga 2000's case)
and a small jeweler's screwdriver (to turn the adjustment screw). The
small jeweler's screwdriver should have a blade that is only about a
sixteenth of an inch wide. Screwdrivers of this type are sold for
working on eye glasses; also, most Radio Shack stores carry a set that
contains three miniature screw drivers of different sizes.
Before I adjusted my clock, it would gain two minutes a day. After I
adjusted the clock with the help of the Calibrate program, it loses a
few seconds a week. (Luck played a part in this success.)
2 THE CALIBRATE PROGRAM
If you wish to use Calibrate from the Workbench and your country does
not use 60 cycles per second alternating current, you will need to
edit the tool types stored in the Calibrate icon. To do this, click
once on the Calibrate icon to highlight it. Then select the "Info"
menu item from the "Workbench" menu. In the "Tool Types" portion of
the Info Window, you will see a line that looks like "hertz=60".
Page 2
Click on this line and edit it to reflect the power line frequency of
your country (if you don't have 60 cycles per second power you
probably have 50 cycles per second power). Then click on the "Save"
gadget on the lower left corner of the window.
After you have set up the icon for the Calibrate program, you can run
it from the Workbench by double clicking on its icon.
To run the Calibrate program from the CLI, simply type the command
run calibrate
and press return. If you live in a country that does not use 60
cycles per second alternating current, specify the frequency of your
electricity after the "calibrate" in the command. For example,
run calibrate 50
Regardless of how you run the Calibrate program, it will open its own
window to display its results. This window will have the standard
"close", "window to front" and "window to back" gadgets. Next to the
front and back gadgets is a orange and black gadget labeled "Restart".
This gadget can be used to start a new round of testing without having
to exit the program and run it again.
In the window will be three columns of information. The first column
is the elapsed time as measured by the line frequency clock. This
time will be displayed in units of ticks since testing began.
Remember, this clock ticks once for each cycle in the AC current. So
a reading of 600 means 10 seconds for North America. The numbers in
this column should increase by 10 seconds worth of ticks every line.
The second column is the cumulative absolute error between the line
frequency clock and the battery backed up clock. As is the number in
the first column, this number is measured in ticks. A positive number
means that the battery backed up clock is gaining time relative to the
line frequency clock. A negative number means the battery backed up
clock is losing time. Typically, this number will slowly increase or
decrease as the test continues.
The third column is the cumulative relative error between the line
frequency clock and the battery backed up clock. This number is
displayed as a ten thousandth of a percent. In other words, a reading
of 1/10000% is a relative error of one part in one million. Thus, If
your clock shows a relative error of 100/10000%, it will gain about
nine seconds a day.
The Calibrate program will display a line of results every ten
seconds. At any time you may click on the "Restart" gadget to zero
the elapsed time and restart the calculations of the absolute and
relative errors.
The Calibrate program multitasks well. It does not take over control
of the whole Amiga or do anything that compromises the integrity of
the operating system. However, it does run at a moderately high
Page 3
priority (priority 5) relative to most other programs. Normally, a
program that runs at a high priority will keep normal programs from
running. Calibrate does not do this because it spends most of its
time asleep. Calibrate sleeps for ten seconds, then spends a half
second computing and displaying its results, and then goes back to
sleep. During the ten seconds that Calibrate is asleep, other
programs on the Amiga will run normally. During the half second that
Calibrate is computing its results, most programs will seem to freeze.
Do not let this bother you: those programs will resume at the end of
the half second as if they had never been interrupted.
Although you may run other programs at the same time you run
Calibrate, Calibrate's measurements may be more accurate if it is the
only program running. (The effect that other programs have on
Calibrate's measurements depends on what the other programs are doing
and their priority.) For the most accurate results, Calibrate should
be the only program running.
Since Calibrate does not interfere with the system, you may want to
try running it before attempting to calibrate your battery backed up
clock to become familiar with its display and controls. You may also
want to run it a few days after calibrating your clock in order to
check its accuracy.
The line frequency clock that Calibrate reads in order to do its job
is actually "owned" my the Amiga's operating system. Since Calibrate
only reads the value of this clock, it does not interfere with the
operating system. However, since the operating system is using that
clock for its own purposes, the operating system sometimes interferes
with Calibrate. About every ten to fifteen minutes, the operating
system will alter the setting of the line frequency clock behind
Calibrate's back. This means that Calibrate will report terribly
wrong results about every fifteen minutes. If Calibrate seems to be
reporting erroneous results, click on the "Restart" gadget to start
testing over.
3 ADJUSTING THE BATTERY BACKED UP CLOCK
Turn your Amiga and its monitor off.
If your monitor is setting on your Amiga, take it off and set it to
the side.
Unplug the keyboard and mouse for your Amiga.
Remove the five screws that attach your Amiga's case. Two of the
screws are on the right bottom edge of the Amiga. Two more are on the
left bottom edge of the Amiga. The fifth screw is in the middle top
of the back of the Amiga next to the fan.
Remove the case by gently sliding the case forward. If you feel the
case hang, it may be catching on wires in the Amiga. If this happens,
try tipping the back of the case up a little bit so that it clears the
Page 4
wires.
WARNING: Once the case is off the Amiga, it becomes sensitive to
static electricity. Do not touch any of the circuit boards in the
Amiga. A simple touch could destroy the Amiga.
Plug the keyboard and mouse back into the Amiga.
Boot your Amiga with the case off.
Run the Calibrate program.
Locate the adjustment screw for the battery backed up clock. Standing
in front of the Amiga, the housing for disk drives will be on your
right hand side. Just to the left of the drive bays, will be the
first slot of your Amiga. This slot is the CPU expansion slot for
plugging in a 68020 board to speed up your Amiga.
Between the end of the CPU slot and the front of the Amiga is the
small variable capacitor used for tuning the clock. This capacitor is
labeled VC800, and on my Amiga is colored bright yellow. This
capacitor is a small cylinder with a small screw in its center. This
screw is used to adjust the battery backed up clock.
If the absolute and relative errors shown by Calibrate are positive,
your clock is gaining time. To make it run slower, turn the screw
clockwise.
If the absolute and relative errors shown by Calibrate are negative,
your clock is losing time. To make it run faster, turn the screw
counterclockwise.
When I was adjusting my clock, it appeared that the adjustment range
of the screw was only 90 degrees. Turning the screw more than 90
degrees merely puts you in a different quadrant were a clockwise turn
in that quadrant slows the clock and a counterclockwise turn speeds it
up. So, do not turn the screw more than 90 degrees.
After you adjust the screw, wait a few seconds, click on the Restart
gadget in the Calibrate window. The reason for waiting a few seconds
is that the clock seems to behave erratically for a few seconds after
adjustment.
After you click on the Restart gadget, the Calibrate program will
display the statistics on the newly adjusted clock. After a few lines
of measurements are displayed, you may want to make further
adjustments to the clock.
After you are satisfied with the accuracy of your battery backed up
clock, turn your Amiga and monitor off, unplug the mouse and keyboard,
and replace the cover.
Reboot your Amiga. Set the time, and use the SETCLOCK OPT SAVE
command to save the time to the battery backed up clock. Later on,
after a few days pass, you may want to compare the time stored by your
Page 5
battery backed up clock to the correct time. This is the best method
to check the accuracy of the battery backed up clock.
4 ACCURACY OF THE CALIBRATE PROGRAM
The Calibrate program may not allow you to adjust the clock as
accurately as you might like. The major problem is the accuracy of
the power line frequency. Averaged over the period of a day the line
frequency is extremely accurate (otherwise electric clocks would gain
or lose time every day). However, over the course of a few minutes
the frequency may be slightly off. For example, as small a change as
the line frequency being only 59.994 cycles per second instead of 60
cycles per second when you calibrate your clock will result in a nine
second per day error in your clock.
After calibrating my clock, comparing the time after week long
intervals showed that it was accurate to about a second a day.
However, if I ran the Calibrate program at certain times of the day,
the program would report relative errors that predicted a twenty
second a day miscalibration. At other times of the day, the Calibrate
program would report relative errors that showed my clock to be
perfectly accurate. Once, the Calibrate program showed absolute
errors that were positive and increasing for awhile, then the errors
would decrease to zero and then become negative; finally, the absolute
errors would began increasing until zero and then become positive
again. The absolute errors described as sine wave with period of
about a hundred seconds! The conclusion: I had adjusted my clock to
be more accurate than the power line frequency when measured over
short periods of time. This meant that I could now use the Calibrate
program to find the errors in the line frequency on the basis of the
battery backed up clock rather than vice versa!
Even if the power line frequency is perfectly accurate, each
measurement of Calibrate program could be off by one tick. This means
that you should not make an adjustment simply on the results of one or
two lines from the program. After making an adjustment, allow the
program to run for a few minutes to confirm the trends in the
statistics displayed.