Skip to content

uChip/FrequencyReference

Repository files navigation

Programmable Frequency Reference

Programmable Frequency Reference with 1 ppm accuracy

Screen capture of 10 MHz Frequency Reference signal

This repository contains the design files and write-up for a Programmable Frequency Reference board based on the RALTRON RTX0230LC*. The RTX0230LC is a ~1ppm accurate and stable crystal oscillator. It is temperature compensated and tunable. The oscillator drives the master clock of an ATmega328 microcontroller which then generates the output frequency by dividing down the master clock. The ~2Vpp output signal is available on the BNC connector and has been impedance matched to 50 Ohms.

A set of common (and even**) frequencies from 10 MHz down to 152.6 Hz is selectable via a rotary encoder. As each frequency is selected a representation of that frequency is shown on the display. The following table shows the frequencies available and the displayed value. Common Frequency Table

NOTE that the display is NOT a measure of the produced frequency.

Within the microcontroller the TCXO clock drives Timer/Counter1. The Timer/Counter1 is configured to count up until the value matches that in Output Compare Register A (OCR1A) at which point the counter is reset to zero and the output pin OC1A is toggled. The values for OCR1A are selected from a table when the encoder knob is turned.

Alternatively, pressing the encoder knob will change the mode of the software and instead of choosing from a table, an integer divisor value (0 to 65535) is shown on the display and sent to OCR1A. The count is incremented or decremented by turning the encoder knob. The output frequency will be a function of the integer value as follows:

F_OUT = F_CPU / ( 2 * ( OCR1A + 1 ))

Pressing the encoder knob again returns the software to the common frequency mode.

The mode, table value and divisor can also be sent to the microcontroller over USB through the board's FTDI interface. For details on USB programming, see the document USB_Programming.pdf in this repo.

The firmware folder contains an Arduino sketch and associated library that is source for the microcontroller code.

The next revision of the board will be designed to accomodate other oscillators should the RTX0230LC become unavailable or if even higher precision and stability are required. Also, the firmware can be used on an "off the shelf" Arduino Uno to create a functional but less accurate frequency generator. See the file VariationsOnATheme.pdf in this repo for more details.

NOTES

* The RALTRON RTX0230LC is a surplus part cheaply available (~$5.50 for 5 pieces at the time of this writing) on ebay. http://www.ebay.com/sch/i.html?_odkw=RTXO230&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.XRTX0230.TRS0&_nkw=RTX0230&_sacat=0

** Mostly. All but the last are even numbered divisions of the master clock. The last is the highest possible divisor, 65535, generating the lowest possible*** frequency.

*** Not really. The firmware configures the timer/counter to be driven by the system clock. By reconfiguring, the timer/counter could instead be driven by a prescaled clock. Prescaler values are 1, 8, 64, 256, 1024, allowing for much lower frequency generation if needed. The prescaler value can be set via the USB interface.

Order PCBs

Programmable Frequency Reference with 1 ppm accuracy

If there is sufficient interest I will build and calibrate a batch of these to sell. If you would like one, please contact me.

You can order this PCB directly from OSH Park. Click on the following link.

PCB Top

PCB Bottom

See the Bill of Materials (BOM) file for a parts list.

Status

  • Rev A PCB and firmware have been tested to be functional. Rev A is an earlier branch in this repo. The design has since moved on to add support for other oscillators.
  • Rev B Not yet complete or tested.

File Formats

Hardware design files are in "CadSoft EAGLE PCB Design Software" .brd and .sch formats. A free version of the software can be downloaded from www.cadsoftusa.com.

The example code is in Arduino .ino format (text). A free version of the Arduino software can be downloaded from www.arduino.cc.

Documentation is generally done in Wordpad .rtf and Excel .xlsx.

Viewable versions of layout, schematic and documentation are generally available in common formats such as .pdf, .png, .jpg, .txt, etc.

Attributions

While the board layout, circuit design and microcontroller firmware are all my own, the idea for this project grew out of the 3 Dollar Precision Frequency Standard thread started by paulie on EEVBlog forum http://www.eevblog.com/forum/projects/3-dollar-precision-frequency-standard/

Distribution License

License: Creative Commons License
Programmable Frequency Reference by C.Schnarel is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

About

A reasonably good (accurate, stable) programmable frequency reference

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages