1 / 11
GPS-Disciplined Frequency Meter — image 1
1 / 11

GPS-Disciplined Frequency Meter

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

GPS-Disciplined Frequency MeterThe purpose of this project is to measure a 32,768 Hz RTC clock frequency against the 1…

Rating
0 / 5
Likes
1
Downloads
5
Makes
0
Views
28
Reviews
0

Updated at source:

Model information

Category
Electronics
License
Creative Commons — Attribution — Share Alike

GPS-Disciplined Frequency Meter

The purpose of this project is to measure a 32,768 Hz RTC clock frequency against the 1 PPS (pulse per second) signal from a GPS module, with the highest possible accuracy. It can be used to fine-tune digital clocks. The frequency counter has a 144 million count resolution, and by averaging multiple measurements, the accuracy can be improved even further.

Any other frequency can be measured with similar accuracy provided it is divided down to 1 Hz and fed to the 74HC73 input. Replace "32768" multiplier in firmware with the nominal frequency. The PCF8563 circuit can be omitted in this case.

It is fascinating to watch a digital clock quartz oscillator react to the environment—its frequency drifts by 2 PPM when warmed by sunshine, then settles back to less than 1 PPM error slowly as the shade falls.

The basic idea is to divide the 32,768 Hz signal down to 0.5 Hz using hardware, and count the MCU clock pulses (144 MHz) while this 0.5 Hz signal is high. Simultaneously, the 1 PPS signal from the GPS receiver module is also divided by 2 to obtain a 0.5 Hz signal, and the 144 MHz clock pulses are counted while this signal is high as well.

By comparing the two count results, we can determine the accuracy of the 32,768 Hz oscillator. The resolution is 0.01 ppm. Many RTC oscillators can be tuned by adjusting a small external capacitor (4–20 pF). It is amazing to see the measurement accuracy (to 4 decimal places) while adjusting this capacitor—the count remains extremely stable.

The MCU used is a CH32V203, running on a 144 MHz clock. Several code blocks have been written from the ground up with AI assistance, as Arduino support for the CH32V203 is available but still early-stage and considered a work-in-progress (see https://github.com/ch32-riscv-ug).

Hardware Details:

GPS Module (Neo-6M): The PPS signal drives the LED on the module. Following the PCB track, Pin 3 is the Timepulse output. The TX pin is connected to PA3, allowing GPS sentences to be captured via UART2 and parsed for position, real-time data, satellite count, etc. (code uploaded). The GPS module has a 1-meter cable and can be placed near a window for better satellite reception.

MCU Clock: The CH32V203 uses an external crystal oscillator for stability (essential), and the core runs on a PLL-generated 144 MHz clock. This same clock signal is used for Counter 2 and Counter 3 for input.

Gate Signals: PA3 and PA6 receive the two 0.5 Hz signals. These signals are obviously not in sync, so the firmware handles synchronizing the two counters to the incoming pulses. The counters overflow more than 2,000 times—this overflow count is also tracked. When the gate signal goes low, the final result is calculated as:  

                               (65,536 × overflow_count) + counter_contents.

The ratio of the two 144 million count values shows the deviation between the two 0.5 Hz frequencies. Multiplying this ratio by 32,768 yields the actual RTC oscillator frequency.

RTC Chip (PCF8563): This chip has a 1 Hz output, derived from its internal 32,768 Hz oscillator (register 0x0D must be written with 0x80 to enable this). The oscillator input pin (Pin 1) can be connected to a crystal with a tuning trimmer, or to an external 32,768 Hz source. The input is overvoltage-protected.

TFT Module: The SD card socket was removed to save space inside the tight 3D-printed case.

LED Indicator Board: An 8-bit LED PCB displays the two 0.5 Hz pulses and the GPS TX line activity for basic hardware verification.

Reset Switch: A reset switch clears the counter results. Data can be followed on the serial output.

Errata : (Drawing redrawn with these changes on 02 aug. 2026)

 -Reset capacitor 100nF missing on schematics drawing (pin 7 to GND).
--Swap I2C pins PB6 PB7 on drawing.
--There should be a 3.3V regulator after the USB input, the circuit runs on 3.3V
--It is good to have a pullup resistor 5k6 on the external input ( PCF8563 pin7 open drain output)
-- It is good to have 680 ohm series resistor on the input before the clamping diodes

Tags

Category: Electronics

Tags