Application Note 002: Oscillators Using External Resonant Devices and GreenArrays™ Chips

Although internal timing loops in our chips can be calibrated to suffice for many application requirements, there are times when a more accurate time or frequency reference is demanded. In addition one may wish for a way to introduce time delays without incurring the 4.5 mW power consumption of a node running timing loops. In this App Note, we explore several different ways of using minimal external circuitry to accomplish these things, and will compare their energy costs.

The ideal model for this function will be one node with some external circuit on one pin. Our examples will use minimal circuitry, such as a single resonant device connected between a single pin and ground.

The magic in these examples comes from our uncommon I/O pin electrical characteristics; from our computers that are fast enough to implement software defined I/O, generically referred to as "bit banging", at uncommon speeds; and from an architecture that permits us the convenience of employing an entire computer to attend to the duties demanded at a single I/O pin.

In the following sections we will explore the use of external crystals and R/C networks.

32.768 KHz Watch Crystal

In this exercise, we will use a Seiko VT200F-12.5PF20PPM crystal which resonates at 32.768 KHz, with tolerance of ±20 parts per million (available down to five) and load capacitance of 12.5 pF (available down to four.) The package is a metal cylinder 6mm long and 2mm in diameter.

Using a GA144-1.10 (proto chip #004) in socketed test board #3 with Vdd at 1.80V, we connect this crystal between pin 16 (signal 300.17) and Vss; as initially tested there are about 1.25" of wire (30 nH) between the crystal and Vss, and about 2.25" of wire and PCB trace (57 nH) between the crystal and the chip pin.

Our motivation for using one pin rather than two, and for omitting other parts, is to prove that we can do without these things. Our view is that additional parts are only justified if they earn their keep, which includes any additional energy they may require by their mere presence.

Learning Startup Requirements

The first problem to be solved is to excite the crystal sufficently for it to begin producing an oscillation whose amplitude crosses the input switching thresholds of F18A pads. Given the high Q of the crystal, this means we will need to excite the crystal very near its resonant frequency; we will have to do this using timing loops, and since the period of a timing loop depends on variables such as Vdd, temperature, and process variations, we know it will be necessary to search for this frequency. Until we experiment with a physical crystal, we won't know how narrow a frequency window we will have to hit, and we don't know how much excitation will be required.

Initial investigation begins using our Interactive Development Environment (IDE) to program the chip and test the node under test. We also need to see what is going on at the pin, and we'll continue to need this until we are certain we can start the crystal successfully. For this purpose we connect a Tektronix P6131 10:1 passive probe (10 Megohms, 10.8 pF) to the "high" leg of the crystal about 1/4" from the can, and observe it using an analog input on an H-P 1631D logic analyzer (minimum sample interval of 5 nS.)

Our strategy will be to have the node under test stimulate the crystal with a given number of cycles of a square wave whose period is timed by a different number of iterations of an empty unext (micronext) loop. The code being used gives a resolution of one micronext iteration, or roughly 2.5 nS, for the period as a whole. When the desired number of square wave cycles has been completed, and the last phase driven was low / Vss, the node will immediately set the pin to high impedance (250 megohms, 2.8 pF, plus, for now, the scope probe and wire/board parasitics.) We will watch the pin throughout the series of excitation cycles and will then look for a signal immediately following; the excitation square wave's period will be adjusted, manually, 2.5 nS at a step, until we see oscillation.

Since we may need to stimulate the crystal for a long time to impart the required amount of energy, we will use signal 300.1 as an output which goes high at the end of the stimulus phase when the crystal pin goes to high impedance; this may be used for scope triggering when the period of interest begins.

This diagram and phot reflect the initial test set-up:

Initial test diagram Initial test photo

The initial tests will use this code for node 300:

first phase exploring crystal excitation. br

light attempts to excite a crystal by giving i
n+1 cycles of a square wave whose period is
unext iterations plus a little overhead. t
he square wave phases are half the period give
n with remainder if any added to the low phase
. after the final low phase, pin
17 is set to
high impedance and pin
1 is driven high to sig
nal beginning of the observation period.
use 3 vice 30003 and 2 vice 20002 to generate
pulses instead of square waves.

makes an attempt to light the crystal usi
ng the period on the stack for the number of c
ycles given by literal in the definition.

does this with a given period.
makes a try1 using period on stack, shor
tening that period by
1 afterward to increase
frequency. push starting period onto stack ini
tially using
nnn lit first in the ide. it is b
est to increase frequency since the chip slows
down as it heats.                             

   1332 list
32.768 khz xtal 300 node 0 org
k n io b! for cr
2 30002 30002 .. !b !b dup 2/ for unext cr
2 20002 20002 .. !b !b dup 2/ over 1 and . + f
or unext next drop
hi-z 3 !b ; cr
38 org
038 12138
k-k 03A 50 200 light ;
k-k' 03C dup try1 -1 + ; 03F            

For the crystal frequency of 32.768 KHz, the period is 30.518 microseconds. At roughly 2.5 nS per unext iteration, the period would be roughly 12,207 loop iterations per cycle at typical room temperature. In reality the number should be a bit smaller than this because of the time required for the other work done during each stimulation cycle.

For each of the following tests we will manually try a range of frequencies, using sweep to search for the crystal's resonance. This range will be shifting as the temperatures of the chip and the room vary, so some patience will be required.

Initially, we try 50 cycles of stimulus. The following trace shows no oscillation:

50 cycle stimulation

This is not what we need to see; even mechanically banging on the crystal should get it to oscillate at its resonant frequency with low amplitude. So we speculate that we simply have not put enough energy into it with this small sequence of square waves. Increasing the loop count in try1 from 50 to 200, and setting the scope to trigger on the rising edge of 300.1, we obtain the following:

200 cycle stimulation

This is more like it! With more searching the resonance can be sensed, but the most we are getting out of the crystal is on the order of 100 mV peak to peak. Nevertheless, it is clearly resonating, given that we are seeing a signal at the correct frequency.

Increasing to 1000 cycles, we found the resonance; the maximum signal increased to +500, -125 mV and the resonance seems to be two or three of our period durations wide, which bodes well for our being able to automate this process! Now we go to 5000 cycles and are able to put enough energy into the crystal that it is exceeding our supply rails:

5000 cycle stimulation

Interestingly, this resonance continues for quite a long time, even though the protection diodes are extracting energy each cycle. Further interactive experimentation followed, varying the start-up method, leading to these observations:

Now that we know it will be feasible to start the crystal under program control regardless of the variables affecting our timing, we need to develop and test that program and then to implement the code for replenishing the energy of the crystal so it will oscillate indefinitely. Along the way we will be seeking ways to minimize the energy consumed in both starting and sustaining the oscillation.

The first step will be to use signal 300.17 as a super high impedance scope probe, copying what is seen on that pin to 300.1 where it may be viewed on a scope without loading the crystal down any more than it will be when operating. We'll use this capability whenever we need to check what is going on without that relatively low impedance passive probe mucking up the data; it is one of the amazing capabilities of our architecture to actively probe a signal under actual operating conditions without perturbing that signal in any measurable way.

To be continued...