A straightforward HF precision reference, based on TV sync or GPS as a reference source.
This project is a simple application of frequency precision. It uses a widely available precision frequency source (TV network sync is often derived from a Rubidium source), and provides accurate time and frequency. It can be used as a simple Precision Reference, say at 5 MHz or 10 MHz, or without phase locking circuitry, as a phase comparator for a high quality reference. The Amateur band version of this design includes modulators and Morse ID, so can also be used as an Exciter for a Precision Frequency Transmitter.Schematic - PHASE-LOCKED LOCAL REFERENCE
The TV Reference Concept
The design might look complicated, but just about everything shown takes place inside just one IC, a small micro. The Sync Separator, (separates the 50Hz sync from the composite video TV signal) adds a second IC. Both are inexpensive. The main IC is the ATMEL AT90S2313 AVR device, a simple 20 pin chip. The video source can be a TV receiver or video recorder tuner, tuned to a network which uses a Rubidium Reference (in New Zealand, TV1 and TV2; in Australia, the ABC).
There are two essentially similar designs. Both use the same PC software for monitoring. The only difference relates to the reference oscillator.
The phase-locked performance is fairly good - check out this narrow spectrogram of the transmitted signal. Over a seven hour operating test period, the signal did not deviate by more than ±0.1Hz (that's 2.6 parts in 108). Note also the speed of recovery from power loss, and the fact that the signal returns to the same frequency.
There have been other TV-derived references in the past (e.g. "Low Cost TV-derived Frequency Reference", Electronics Australia Oct-Nov 1993). However the performance has often been poor due to signal path effects, modulation of the reference by TV video, and poor locking. This present design uses a high performance sync separator, and a micro controller with special phase lock firmware, to provide exceptional performance. The remaining issues with a reference of this type centre around knowing when the TV source is "on reference" and when it is not, and this is also addressed in the present design. Some of the features of the unit are:
/BLOCKQUOTE>
Micro Section
Follow the Reference Schematic as you read this description. (The other version is similar - just cut-down somewhat). Power for the Precision Reference unit can come from two sources - a simple plug-pack connected to the points labelled "+10V" and "-0V", and a backup battery, B1. The supplies are isolated from each other by diodes D3 and D4. These diodes also prevent reverse supply damage. When the plug-pack output (nominally 10-12V DC) is higher than the battery voltage, D3 is reverse biassed, D4 is forward biassed, and the unit operates from the AC supply.When the AC supply fails, D3 conducts, D4 is reverse biassed, and the unit continues to keep time from the battery. If power failures are frequent, a 6-cell 500mAH or better NiCd or NiMH battery pack is recommended. The backup isn't necessary if the clock feature is unused, so omit B1 and D3.
Regulator U1 provides 5V with sufficient current to operate the micro controller, sync separator and buffer/modulator device. The total load is only about 20 mA. It is convenient to operate the Exciter from a small SLA (gel-cell) battery, and the power amp from an AC supply. If the power fails, at least 10mW will leak through the power amp. Battery operation is intended only to keep the clock accurate, as the phase-lock TV reference source will be lost.
The RS232 transmit signal from the micro to the PC requires a negative voltage supply, and to keep supply current to a minimum, this voltage is derived from the mostly idle PC transmit data line, which is normally negative. TR1 converts to RS232 levels and transmits the serial data. Note how its collector supply is derived from the RS232 receive line at J2 pin 3, via D1 and R28. C8 maintains the -10V supply even when data is being received from the PC. TR2 is the RS232 receiver, with D2 catching the reverse voltage to prevent reverse bias damage. The RS232 connection is purely for time setting and phase monitoring. Full phase-locked operation continues with the PC off or disconnected.
J1 is the programming header, a simple 2x5 pin connector. The micro can be programmed in the unit. The operating frequency and ID message, stored in EEPROM, are changed in the same way.
X1 is the reference crystal, which operates in a variable crystal controlled oscillator configuration (VCXO). The oscillator is the main reference oscillator in the micro, and so is used for all timing. The components C2 and C3 set the precise crystal oscillating frequency, which can also be trimmed over a range of about 30 Hz by the variable capacitance diode D2. In the prototype a 47V Zener diode is used as the varicap. The voltage on the varicap is provided by the micro via a pulse-width modulated output, operating at about 100 Hz, but with 8 Hz fine adjustment timing components. The PWM output is averaged by R36 and C8 to remove most of the PWM and leave a clean DC ERROR signal. Since the bandwidth of the varicap frequency shift is very low, the remaining PWM ripple is not modulated onto the carrier (4 Hz sidebands about 60dB down, and 100 Hz sidebands unmeasureable).
In the Reference Phase Comparator version, the micro operates directly from the 5MHz or 10MHz local reference, and U3/1 is used instead as a buffer for the incoming reference to drive the micro. There is no phase lock, and the ERROR signal is simply used with a phase indicating meter. The firmware remains the same. Telemetry to the PC provides an indication of the phase drift, and the PC also calculates the frequency offset of the local reference from the TV sync source. This is a good way to check whether the TV station is "on reference" or not. A unit of this type can be fitted inside a local reference unit and provides continuous calibration updates while the unit is in use.
Firmware
The micro controller has three program loops - main, 2 kHz divider, and 50 Hz TV sync. The reference oscillator operates a 16 bit divider, used as the phase counter. When the defined count is reached (every 500µsec), the timer interrupts, the 1 kHz output is toggled, the pulse width modulator stepped, and a divide by 2000 firmware counter stepped, allowing seconds to be counted. The PWM is oversampled and generates 8 bit resolution in only 10ms, rather than the expected 128ms. These are all tasks requiring high timing precision, either to ensure accuracy, or prevent carrier phase noise.Once every second the 2000 software counter overflows, and a flag is set. In the main program, when this flag is seen, the 1Hz pulse is generated, UTC time is incremented, and the serial output updated. These are all tasks which are not precision time dependent, but still occur within a few microseconds of the precision event which triggers the activity (the setting of the flag). Otherwise the main program does very little and the micro remains asleep untill needed.
The third task happens when the 50 Hz TV frame sync reference arrives. The content of the phase counter is sampled (in hardware, so no precision is lost), and the interrupt generated. In the interrupt, time precision is unnecessary; the phase error calculation is made and the new error value provided to the pulse width modulator.
Time is kept in packed BCD format (Binary Coded Decimal, where the lower four bits represent the units 0 - 9, and the upper four bits represent the tens), which makes counting more tricky, but simplifies display. Every time the UTC time is incremented, the BCD values need to be checked to ensure they follow the BCD format, which means checking that the low nibble is <10 and the high nibble <6. The hour is checked to see that it remains <24, and is set to zero when 23 is exceeded.
Local Calibration
The main use for the Precision Reference is the most obvious one - as a local reference for calibrating other equipment. Any equipment with an external reference input (such as a frequency counter) can also benefit from the use of such a reference.The non-locked version can be used to adjust and monitor the performance of a local high stability OCXO (Oven Controlled Crystal Oscillator) reference. The author uses this design to periodically check the calibration of a 5MHz Rubidium oscillator.
Link to Calibration Procedure
The two local reference versions do not have ID or keying, and the Comparator version has no phase lock. It is used only for monitoring a local OCXO reference and comparing it to the TV reference. Both these versions retain the accurate clock, which is available only via the serial message.TRANSMIT (DATA)
The serial communications data transmitted to the monitoring PC is of the form:
HH:MM:SS PPPP<CR><LF>where PPPP represents the phase of the local counter sampled by the external reference, the 50 Hz TV frame pulses. The value of PPPP can be from 0000 to one less than the divisor required to divide the clock reference to 2 kHz, and is expressed in 16 bit HEX. For example, operating on 3600 kHz, the value is (3600 / 2) - 1 = 1799 or 0707HEX.The Precision Reference also transmits responses to some of the time setting commands (those in red in the table below). These three commands should not be used while transmitting, as they disturb the carrier phase as well as the UTC timing. (This is why the PC monitoring software is not equipped for time setting).
RECEIVE (COMMANDS)
There are no front panel controls for the clock section of the Precision Reference. After all, the clock is Rubidium Standard accurate, and battery backed, so what would need adjusting? All adjustment is achieved using the serial link to a PC. There are eight commands:
Hnn Set UTC hours to nn (BCD) hours Mnn Set UTC minutes to nn Snn Set UTC hours to nn+ Add one to UTC seconds - Subtract one from UTC seconds > Increment local time offset by one hour < Decrement local time offset by one hour R Retard clock by 10 msThe commands should be used in the order shown while setting the clock. The commands shown in red cause the clock to stop while they are entered, so must not be used during time-keeping. They also disturb the PWM part of the frequency control, causing frequency disturbances. Lower case letters are accepted and used as upper case. Invalid commands are ignored. The clock can be set with a simple ASCII terminal program, such as Windows TERMINAL, or even HYPERTERM.
By comparing the Precision Reference seconds ticks with a reference such as a GPS receiver with 1pps output, the clock can be set to within 10ms of real UTC time, and when calibrated, may stay there for months on end (dependent only on the TV network). If the calibration of the VCXO is good, it will be quite adequate even without the TV reference, but the seconds ticks may need to be pulled back in line before the next transmission session.
The Precision Reference is used as a means of monitoring the performance of your high stability local reference (such as a 5MHz or 10MHz OCXO) compared with another reference. This version can be used with or without phase lock. Using phase lock, it operates with the Phase-locked Local Reference design.Used without phase lock, this version is used with the Phase Comparator for References hardware version. The precision OCXO it monitors runs unaffected, but the phase and frequency are monitored, and the phase feedback output indicates phase via a meter and via the same PC software. The PC software supports all versions and all applications. It operates by displaying the oscillator phase graphically over time. It also calculates the frequency offset by accumulating the phase error across the screen. The phase display easily shows drift and short-term variations, while the frequency display indicates long term frequency and averages out short-term errors.
PC Software monitoring a locked reference
(Click on image to view full size)The above image is shown with negative colours for improved clarity (the actual background is black). The top half of the screen constitutes the main graphical display. The red line in the main display is phase, measured from one minute after oscillator switch-on, with a duration of 10 hours. Above it, the black line with the brown "lump" at the left end is the frequency measurement. The error at the beginning is caused by the phase drift of the oscillator as the unit warms up. The frequency error is never greater than -1 part in 108. If there had been any disturbance of the TV sync refernce during the operating period, it would show clearly as a change in phase followed by a large change in frequency offset.
The lower display is the "fast phase" display, used mostly during calibration. Below that is a circular phase meter and a text display of the operating phase and frequency parameters and program settings. The current frequency offset (largely irrelevant with a locked oscillator) is shown at the top right above the main display.
The PC software is used for initial calibration, and in order to monitor long term phase performance. Long term performance monitoring is also a measure of the reliability of the TV network reference. The PC software is available as both executable and source code (if you order the source code, you get both). The PC software is a DOS executable program, which will operate from Windows™ 3.1, 95, 98 or 2000 (because it is a graphics program, on older computers it may require full-screen rather than "DOS Box" operation). Computer requirements are minimal - a 486 processor and a serial port. Given the simplicity of the communications protocol, you could easily write your own phase and time display or data logging program. To recompile the source code you will need Microsoft Quick Basic 4.2 Compiler or similar. The source code may also run under "QBASIC" which was supplied with DOS 6, but it will not compile to a stand-alone executable.
The source code and executable programs for micro and PC are available from the author at a very modest cost. See the Micro Page for details.
You can edit and compile the source code for yourself by getting a copy of the AVR Assembler free from Atmel. You will also need a copy of the ISP, or "In System Programming" software, free from the same source.
You will also need to use the ISP software to modify the EEPROM map file supplied, in order to set the carrier frequency, the required serial data rate, and the ID message. If the unit is not used as a transmitter, the message is not necessary, but the other values will still need to be set. Instructions are supplied with the firmware.
HOME