A Low Cost Microcontroller Compensated Crystal Oscillator
A Low Cost Microcontroller Compensated Crystal Oscillator
Robert Aurand
Murata Electronics
Crystal Oscillator Division
State College, PA 16801
954
0-7803-3728-X/97/$10.00 0 1 9 9 7 IEEE
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
11. BACKGROUND 111. DESIGN OF THE MCXO
Thermal stability ofTCXO’Shas beenlimited by the A simplified block diagram of the MCXO design
resistor networks used to generatea varactor tuning is shown in figure 1. A standard Colpitts oscillator circuit
voltage for crystal frequency compensation [4]. isusedwithan ATcut crystal whichis similar to
Replacement of the resistor network with a digital traditional analog TCXO designs. A voltage regulator is
subsystemhas been a desirable alternative whichwas included as part of the Colpitts circuit design to provide
previously
limited commercially by size and cost. powersupply rejection. Theoutput fromthe Colpitts
Constant technological advancements in digital subsystem oscillator is followed by a buffer circuit that generates a
components are making these methods more attractive. square wave CMOS output and isolates the MCXO from
Replacement ofthe resistor networkwith a digitally variations in external load impedance.The input to the
based subsystemhas been done previously in several Colpitts circuit is a varactor compensation voltage
ways. The method of dual mode Microcontroller generated by the microcontroller through the DAC.
Compensated Crystal Oscillators (MCXO) has been
commonly used [ 5 , 61. It has the advantage of deriving the I I
temperature of the crystal using the characteristics of the Thermistor Voltage
crystal itself. This overcomes temperature uncertainty and
thermal gradient errors which become critical when the
desired stability is below 1.0 ppm [ 1-31. Dualmode Microcontroller
MCXOdesignscommonly adjust frequency by direct
digital frequency synthesis. The resulting performance
improvement is accompanied by cost increases due to
additional digital components, replacement of the AT-cut Circuit
crystal withan SC-cut, and additional labor required to
manufacture [3]. A second methodis a more direct
Diode Circuit
replacement of the resistor network with a digital
subsystem that measures temperature and outputs a
compensation voltage [7-91. This method typically Voltage
measurestemperature,convertstemperature to a digital
value, translates the digital value to a compensation value,
and converts this value to a varactor compensation
voltage. Reportedtechniques vary significantly inthe Figure 1. MCXO Block Diagram
precision of the temperature measurement and
compensation output value, as well as the sophistication Temperaturedata used to compensate each
of the translation algorithms [lo-121. crystal are measured by a thermistor and converted to a
16-bit digital value by an ADC. The non-volatile
Our approach usesthemethod of replacing the resistor memory (EEPROM) is used to store calibration data. The
compensation networkwith a digital subsystem. Dual operation
of
the microcontroller can be controlled
mode MCXO performance is traded for reduced cost and remotelythrough a single pinserial interface at 9600
increased ease of manufacture.Thehardwaredesign baud.
differs fromprevious workin several ways. A high The microcontroller compensates by calculating
performance microcontroller functional block enables a 16-bit DAC control value basedonthe temperature
incorporation of complex compensation algorithms. The measuredandpreviously stored compensation data. The
microcontroller canbe clocked at frequencies up to analog signal from the DAC is passed through a two pole
20Mhz, and includes 256 bytes of non-volatile memory low
pass filter to attenuate digital noise
fromthe
and 2Kbytes of code space. Recognizing the presence of microcontroller. TheDAC
has an independently
numerous uncontrollable error sources, the precision of regulated reference voltage.
conversionoperations and
internal computations was
increased wellbeyond the minimum required to The MCXO designandPCB layout isolate the
effectively eliminate these sources of error [7]. In fact, digital circuitry from the analog circuitry. Analog
identifying and understanding the sensitivity to all the circuitry is located on one side of the PCB while digital
relevant error sources was a key to meeting the stability circuitry islocatedonthe other side. Separateanalog
goal. ground and digital ground planes are employed.
955
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
0 Perturbations ofthe temperature characteristics ofthe
Thetemperaturemeasurement circuit forthis crystal
designisbasedon a non-linear, negativetemperature Short term repeatability of the crystal
coefficient thermistor. The thermistor characteristic is 0 Long term repeatability of the crystal (aging)
partially linearized using a resistor network. To improve Fundamental
temperature characteristics of the
power supply rejection for the ADC, a reference resistor varactor
is used. The reference improves power supply rejection Short term repeatability of the varactor
and reduces effects from other error sources in the 0 Temperature characteristics of the Colpitts circuit
temperature measurement, such as undesirable ADC 0 Repeatability characteristics of the Colpitts circuit
component temperaturecharacteristics. Output loading effects of the Colpitts circuit
Calibration of this MCXO design requires no
substitution or “trimming” of components.Once the Desim Controls Design controllable errors sources
appropriate tuning voltage for a particular temperature is involve: data computation and storage precision
determined, the thermistor reading and the corresponding throughout the digital system, calibration data processing
DACvalue are stored in EEPROM memory. During the methods, varactor dynamic range, thermal gradients
normalmode of operation, 16-bit linear interpolation is between system components, output loading effects, and
used to determine the appropriate DAC value required to power
supply variation. A factor of 10 additional
maintainthe desired outputfrequencyover the entire precisionwas used, basedontheneed to extend the
temperature rangefrom -40to +85 C.Since calibration precision of individual parameters beyond the minimum
points canbetaken at any temperature, the interval requirement, if each element was acting alone.
between points can be adjusted to give the best fit to the
crystal’s frequency versus temperature curve (i.e., fewer The required precision for the various functional blocks is
calibration points in linear regions andmore calibration dictated by the required oscillator accuracy, crystal
points near inflection regions). Forthe results presented characteristics, and range of temperature. The minimum
later in this paper, calibration points are equally spaced. temperature precision required is based on the maximum
Each MCXO unit has a single pin serial interface slope ofthe crystal characteristic andis calculated as
that provides communication with a host computer during follows:
calibration. Firmware in the oscillator allows the host
system to read thermistor and DAC values, tune the DAC = Emax (smax * F) 111
voltage, and write to and read
from the EEPROM
memory. By multiplexing multiple serial U 0 interfaces,
an automatic calibration and test
system which
can where STis the temperature precision required in degrees
accommodate 128 oscillators has been developed. C, Emaxis the maximum allowable error in ppm, SmX is
the maximum first derivative of the crystal characteristic,
Error Sensitivitv Analvsis and F is the additional margin factor. Using a typical Smax
Error sources relatedto temperature are numerous [l-4, of 2 ppm per degree C for an AT cut crystal, a Emaxof 1.O
12, 141.Error sources are sufficiently numerous that each ppm , and a factor of 10 additional margin, the resulting
error source must be controlled well beyond the minimum required temperature precision is 0.05 degree C. Since the
required individually. This conservative
approach is temperaturesensor isan analog thermistor, the sensor
necessary to prepare for theworst case whenall error precision is not an issue. An ADC precision requirement
sourcessum.
Errorsources were divided into three of between 11 and 12 bits for the temperature range of -40
groups: Errors that can
be compensated through to +S5 is implied, if the temperature sensor is linear. To
calibration, errors that can be controlled through design, account for the non-linear nature of the thermistor, we
and errors that can not be controlled. extend the required ADC precision to 16 bits. The final
implementation displays a precision of better than 0.05
The
following categories were
considered
important degree C over mostofthe range and a worst case
sources of error: precision of 0.07 degree C at 85 degrees C. Worst case
single measurement rmsnoiseis 0.22degreeCat 85
0 Fundamental
temperature characteristics of the degrees C and improves as temperaturedecreases.
crystal
0 True hysteresis of the crystal The minimum DAC precision required is dictated by the
0 Apparent hysteresis ofthe crystal varactor operatingrange and
the oscillator accuracy
required. Using a typical varactor operatingrange of
956
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
50ppm, an accuracy requirement of 1.0 ppm, and a factor and DAC conversion time. The maximum allowable time
of 10 additional margin, the resulting required DAC lag is based on the slew rate of temperature internal to the
precision is 9 bits. A 16 bit DAC is implemented. Since oscillator. Assuming the internal temperature slew rate
microcontroller resources are not a limitation, at least 16 equals the ambient rate andthe ambientslew rate is 2
bits of precision are used throughout the microcontroller degrees C per minute, the design limit of 0.05 degree C
computations including the calibration data stored in non- error would accumulate in 1.5 seconds. The actual design
volatile memory. Our estimates of the required precision update period varies from 1.6 to 3.5 seconds.
are consistent with requirements reported by other
investigators [7, 151, however all not previous The output frequency of the Colpitts oscillator circuit is
investigators added a margin for cumulative errors. sensitivity to loading effects. To minimize this effect the
output was buffered to producea CMOS level square
wave outputwaveform.Powersupply variation affects
The required calibration table size is determined by the were controlled by independentvoltage regulation for
final oscillator accuracy, crystal characteristics, range of boththe Colpitts circuit andtheDAC. Themeasured
temperature, interpolation method, and dynamicrange power supply rejection was 0.2 ppm per volt for the
expansion to allow for component variability. With other oscillator for the range of 4.75 to 5.25 volts..
factors known, the second derivative of the crystal
frequencyversustemperature characteristic dictates the Phasenoiseis introduced by the fundamental action of
table size. For linear interpolation the maximum error is digital compensation.This noisehasno analogy to any
midwaybetween calibration points. For thethird order process in a traditional analogcompensated oscillator
polynomial which changes the rate-of-change of phase in a continuous
manner. When a digitally compensated oscillator updates,
2 3
6=b,T+b,T + b,T +b, 121 the frequency is adjusted in a discrete step. I f unfiltered,
this results in an abrupt change in the rate-of-change of
phase. Two strategies were used to reduce this effect. A
6 is the frequency error in ppm and T is the temperature
high resolution (16 bit) DAC was used which decreased
in degrees C.Asreported by others, the coefficients b, the minimum voltage step size to 0.002 ppm. Also, a low-
and b, are significant [13]. The linear interpolation pass filter between the DAC and varactor controlled the
algorithm was calculated and compared to the third order
rate-of-change of phase.
polynomial curve. The resulting temperature interval
requirement for calibration was 5 degree C, for
coefficients of b, = -0.0082 and b, = 0.000094, a 1.O ppm Calibration ControlsMost oscillator compensation
maximum allowable error, and a factor of 10 additional
methods use the technique of lumping temperature
margin.These values for b, and b, were typical of the
dependent error sources together at the time of Calibration.
crystals tested. All repeatable temperature characteristics of all
components are therebycorrected at calibration. The
Thermal gradients betweensystem componentsinduced
accuracy of this method is ultimately limited by any lack
by changes in ambient temperature are significant error
of short term repeatability and by long term
aging
sources [ 1, 3 , 4 , 141. The error sensitivity is related to the
characteristics of the temperature dependent system
maximum slope of the frequencyversustemperature
elements.Also, all algorithms and configurationduring
characteristic of the crystal. A typical value of 2 ppm per
both calibration modes and operatingmodes mustbe
degreeCimpliesa0.1 ppm error isinduced by a
carefully duplicated in every detail. To insure equivalence
temperature gradient of only 0.05 degree C . Gradients
between calibration and operating modes, calibration for
arise from differences in thermal time constants of
the design described is performed with the oscillator in the
individual components, low thermal resistance tothe
normal operating mode. A trial set of calibration data is
ambient, thermal
high
and resistance between
entered into the oscillator and a sweep of temperature is
components. The design controlled these error sources by
performed collecting frequency results. After the entire
minimizing the thermal resistance between critical
sweep, all calibration values are adjusted using the
components. Critical components were placed physically
measured frequency and varactor sensitivity. The design
as close as possible and bonded together with thermally
described is also capable of a second calibration mode that
conductive epoxy.No other control measures are used.
interactively converges to a desired frequency at a given
temperatureduring calibration. Whilethis calibration
compensation
A control induced
lag
is by the
methodis faster, we observed the final accuracy tobe
compensation process time which is the sum of the ADC
lower when using this method. The probable causes are
conversion time, compensation value calculation time,
957
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
slight timing inconsistencies between calibration and W . EXPERIMENTAL RESULTS
operating
modes
aggravated by slight variations in
temperature at the individual component level. Freauencv stability
1
The serial U 0 capability of this design simplifies
automated calibration. Two methods of automatic
calibration were investigated. The first method of
0.40
calibration uses closed
a control loopinvolving the
oscillator, an external host computer, andan external
frequency reference. At a selected temperature, the DAC
value iteratively
is adjusted
to obtain the desired
frequency.
Once the desired frequency has been
achieved, temperature and compensation values are stored
in EEPROM andthe procedurecontinues to the next
temperature.
The second calibration method does not attempt
aclosedloopconvergence tothe desired frequency at
each temperature. Instead, a default calibration table
based
on
past experience loaded
is into EEPROM
memory, and then the oscillator frequency characteristics
are measured over the entire temperature range. Based on
measured results, the entire calibration data set is adjusted
and new values are downloaded into oscillator EEPROM.
The entire process may be repeated until the desired error
specification is achieved. Typically, oscillators converge Figure 2. Temperature profile, cold to hot protocol
to within MS ppm within three calibration passes.
958
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
size, and performance of the digital component
technology. The single V 0 communication pin makes the
t
0.50
approach more adaptable than conventional TCXO
0.40 1
I
+Mean - 1 STD 1
designs to totally automated calibration test systems.
-0.30
A n 4 Crystal perturbations are a limiting factor in temperature
stability. In this study, perturbations greater than 0.4 ppm
E were controlled by screening of crystals. Selective
P
P
YO.20 placement of calibration points as ameans to control
0
L crystal perturbations was not
tested systematically,
b however initial tests suggest this as a productive area for
$0.10
C
Q
future study.
3
g0.00
LL
Both apparent and true crystal hysteresis have been
reported to be a limiting factor in oscillator accuracy.
-0.10
However, for crystals, such as the one described inthe
results, hysteresis was too small to observe. Much of the
-0.20 reported hysteresis maybe apparent hysteresis, whichis
-40 -30 -20 -10 0 10 20 30 40 50 60 70 80 easilyinduced by allowing thermal gradients to develop
Temperature (degree C) between temperature sensitive components [l].
Figure 3. Temperature profile, hot to cold protocol Several areas of investigation are ongoingincluding
further performanceimprovementsregarding short term
stability, long term stability, phase noise, spurious
response, and thermal shock.
SDurious response and phase noise
The repeatability reported suggests that by utilizing
Additional phase
noise and other spurious response additional system resources to add more sophistication to
characteristics are an expected result when introducing a the compensation transfer function, the short term
digital subsystem. Controllingthese effects is critical. The temperature stability can beimproved. Also, since the
design described uses standard methodsofphysicaland oscillator is equally capable of applying long term aging
electrical isolation, shielding, and electrical decoupling to compensation, strategies are beingdeveloped to take
minimize the induced phase noise and spurious response advantage of this capability.
effects. However, goodthermal management requires
sensing the temperature at the crystal, which is a
compromise of the shielding andcausesameasurable References
increase in spurious noise levels. To date, all spurious
response levels in the oscillator output are at least 55 dB [ l ] R.L. Filler, “Measurement and analysis of thermal
below the carrier. hysteresis in resonators and TCXO’s,” in Proc. 42&Ann.
Freq. Cont. Symp., pp. 380-388, 1988.
959
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.
[5] A. Benjaminson, and S. C. Stallings, “A
microcomputer-compensated crystal oscillator using dual-
mode resonator” in Proc. 43d Ann. Symp.Freq. Cont., pp.
20-26, 1989.
960
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL. Downloaded on October 23,2022 at 21:13:50 UTC from IEEE Xplore. Restrictions apply.