Software Operated Crystal

This uses one node of a GA144 multi-computer chip to find a crystals resonant frequency and continually pump it to maintain oscillation. This is done to provide an accurate time or frequency reference to the GA144 computers, which are fully asynchronous. In this case it allows us to spend most of our time in a suspended state to conserve power. When running at full speed a node consumes about 4.5 milliwatts, when suspended it only consumes 100 nanowatts.

This was done as part of following these directions from Greenarrays for using the GA144 to control a Sensortag. They go more in depth on this topic in this application note.

These images show the crystal attached the the evaluation board. The crystal wires are soldered directly to the board, while this is is not necessary the wires should be kept as short as possible.

The waveform can be monitored with a good oscilloscope. The probe must be attached before it starts or the disruption will cause the oscillation to stop.

The vertical lines on the rising edge are the points at which the computer wakes up and pumps a bit of power into the crystal. On the falling edge the pin acts as a sink instead, pulling the wave down.

Here is the code from block 980 that powers the crystal:

32.768 khz watch crystal from 715.17 to gnd,
this code takes 27 ua at 2.1v using a seiko,
vt200f-12.5pf-20ppm crystal, 42 cents unit qty
from digi-key.
-osc tries exciting the crystal with n cycles
of period k returning nonzero if it didn't
come back high after last cycle.
searches for resonant frequency over a,
reasonable range. initially we use 5000 cycles
and may be able to shorten this. when we find
resonance, falls thru into
prep which sets up
registers and finally we camp in
run which is
the low power, low duty cycle oscillator.

is test code for finding resonance.,
do not connect any kind of conventional probe
to the crystal; this oscillator will not work
if you load it down even that much.           

980 list
715 xtal osc reclaim 10715 node 0 org,
-osc kn-f 00 io b! for,
02 30000 !b dup .. 2/ dup for unext 06/1,
20000 !b .. over 1 and .. + for unext next,
dup or !b dup 30000 for,
drop @b - -while next ;,
then dup or pop drop ;
14 14450 14950 12700 200 for dup 5000 -o
sc while
drop 1 . + next clang ; then pop drop ;,
prep 1F 0 20000 800 30800 0 20000 800 30800,
dup up a! drop
2C !b !b @ drop run ;
2E dup 5000 -osc over 1 . + ;,
34 reclaim