WWV Time Correction Option


Introduction: With a short-wave receiver tuned to one of the WWV time signal stations (2.5Mhz, 5.0Mhz, 10.0Mhz and 15.0Mhz) it is possible to keep SDR's (and your event files), time to within +-20 milliseconds. This is done by taking the audio out of the receiver, usually from the external speaker or earphone jack, and connecting it to pins 36 (input signal) and 37 (ground) on the DB37 input/output connector.
How it works: Every minute (except at the top of the hour) WWV broadcasts an 800 millisecond 1000Hz tone. On the A/D card is a phase locked loop tone decoder with a bandpass filter tuned to 1000Hz. The output of the tone detector is connected to a digital input port that can be read by SDR. SDR detects this 800 millisecond tone and uses it to keep track of the time. It does this by averaging several minutes' worth of pulses and a lot of digital filtering. About 2/3 of the time it took to write SDR has been the time keeping software code.
Short-wave Receiver and WWV: The short-wave receiver should be a digital type so it will stay tuned to the WWV station you select. Radio Shack has a portable digital receiver for around $80.00 (Model DX-375). You will probably need to have an external antenna. This can be a long piece of wire run between two trees or on top or your roof. For SDR to keep correct time, it needs to have fair reception to one of the WWV frequencies for a few hours each day. You most likely will not get 24 hour reception on any one WWV frequency. At my location I get best reception on 5.0Mhz at night and during the day 10.0Mhz or 15.0Mhz. I normally keep my receiver tuned to 5.0Mhz because I get better, and longer, reception at night.
Using the WWV Option: Before starting SDR, you need to set the time and date on your system to within 15 seconds of local time. You can do this by listening to WWV and setting the time at the top of the minute. After setting the time, start up SDR. SDR will read the time from the system, and from then on, keep track of the time using the 1 millisecond generated by the A/D card. It is important too remember that the only information SDR gets from WWV is the minute mark. You must set the system date and time to +- 15 seconds of local time for the time to lock and have good time information for your event files.

After starting up SDR, and connecting the audio to the A/D card, you will need to adjust the audio level on the receiver. First enter the Debug Mode by pressing the D key. This mode will display the status of the time keeping and other debug messages. The messages are displayed on the last line of the display and are also written to a file called SDR.LOG. To exit the Debug mode press the D key again.

Start with the volume control about 1/3 of the way up. At the top of the minute you should see the following sequence on the debug line:

06/15/96 15:39:01 Not Locked - Lock Count:1 Diff:435ms
06/15/96 15:41:01 Not Locked Count:2 Width:812 Diff:423ms Avg:432ms Set:1
06/15/96 15:43:01 Not Locked Count:3 Width:828 Diff:436ms Avg:427ms Set:1

The format of the line is:

Date/Time of message.
Not Lock Count: Number of good locks.
Width: Width of the 800 ms pulse detected by the tone decoder.
Diff: This is the current 800 ms pulse start offset in time from the running average.
Avg: This is the running average of the start of the 800 ms pulse.

When the Not Locked Count gets to 6 the system will be locked to WWV. This process may take from 6 to 10 minutes, if you have very good reception, to several hours if you have poor reception. If you are not getting any time messages, and you are getting good reception to WWV, you should increase the volume a little. At some point on the volume control you should start to see the time messages. This will take some time and patience. If you can't get the time to lock see the trouble shooting section below.

When SDR is locked you will see the following messages on the debug line:

06/15/96 17:35:01 Lock Time:1 01:23 Locks:4/12 Diff:3ms Avg:-4ms Set:1
06/15/96 17:38:01 Lock Time:1 01:26 Locks:5/12 Diff:-10ms Avg:-3ms Set:1
06/15/96 17:39:01 Lock Time:1 01:27 Locks:6/12 Diff:-8ms Avg:-4ms Set:1
06/15/96 17:42:01 Lock Time:1 01:30 Locks:8/12 Diff:-1ms Avg:-4ms Set:1
06/15/96 17:42:01 Lock Time:1 01:30 Locks:8/12 Diff:-1ms Avg:-4ms Set:1

The format of the line is:

Date/Time of message.
Lock Time: The time in days, hours, and minutes that SDR is locked to WWV.
Locks: Current number of good 800 ms pulses / last number of good pulses.
This is changed/updated every 15 minutes. Diff: The current pulse start offset in time from the running average.
Avg: The running average of the start of the 800 ms pulse.
Set: Indicates if SDR can set the time. 1 = can set time. 0 = can not set time.

One Second Output: SDR produces a one second output square wave at pin 18. The rising edge of this output marks the beginning of each second. You can use this output to monitor how well SDR is keep time. If you have an o-scope you can monitor this output and compare it to some other reference. One reference can be the audio output from your WWV receiver and comparing it to the 1 second tick you hear (this tick is 5 cycles a 1000hz).
Simulating the WWV Signal: If you have problems receiving WWV and if you have access to another time source, you can simulate the WWV signal. Under the F6 setting you will see an option called Set Time Using Digital Input. If you set this option to Yes, you can then feed a one pulse per minute TTL signal into pin 32 (D_IN0) of the 37 pin I/O connector of my A/D card. The digital signal needs to be an 800 millisecond (+/- 20 milliseconds) pulse that is normally High (+5VDC) and goes Low (0VDC) at the top of the minute. See below:
 +5 --------------------              -----------------------------
      Top of minute -> | <- 800 MS -> |            Next minute ->  |
  0       mark         ----------------               mark         -------...

Note: The PC-Labs A/D card always uses the digital input.

WWV Time Setting Window: Under the F6 menu settings you will see two options for controlling the time correction window for the WWV time option. The WWV Lock Start Time and WWV Lock Time Length setup a time window when SDR will correct its internal time to the WWV reference time. This window is used so that the time correction will only happen when you have a good signal from the WWV station. Depending on what WWV frequency you use, you may only get a clear signal during the day or only at night. By setting up a time window, so that SDR can only correct during the time of maximum signal strength, SDR will not have to correct its time as often do to changing signal conditions.

To setup a time correction window, enter a start time, in Hour:Minute format, in the WWV Lock Start Time field under the F6 settings. Choose a time when you get the best reception for the WWV station you are using. Next enter a time length, in hours, in the next field. I use the WWV station on 5.0 Mhz. I get the best reception at night so I have the start time set to 10PM local time, or 22:00 in the WWV Lock Start Time field. For the length I have 4 hours. This means that starting at 22:00 each day, and ending the next day at 2:00, my system can correct to the WWV time reference. You will still see time correction messages at the top of the minute on the Debug line, if you are out side of the time window, but SDR will not set its time until it gets into the time window.

Trouble Shooting: No Time Messages:
Make sure you are in the Debug mode. The "D" key toggles the debug mode on or off. Make sure you have the audio out (speaker or earphone output) connected to the A/D card. Adjust the volume level until you start getting the time messages. Make sure you are tuned to one of the WWV stations and getting good reception. Also check the WWV time window settings for valid numbers.

Getting Time Messages but Never Locks:

Your system maybe losing interrupts. Make sure you removed all TSRs from your system. Your disk controller maybe disabling interrupts when writing to the disk. Try another disk controller. I use EIDE controllers on my systems without any problems.

[ Top ]

Larry Cochrane - www.seismicnet.com/contact.html